Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What data type is the string?
What data type is the string?
A string is a data type owned by Javascript.

String is a reference type, and parameter passing is a reference passing. However, the change of parameters does not affect the change of the value pointed by the original address, because the change of parameters only changes the reference and does not change the value pointed by the incoming reference.

There are five basic data types of strings: number (integer and floating-point type) header, string, null, Boolean and undefined. In addition, there is a complex data type-object, which is essentially composed of a group of unordered name-value objects. For example, the Date object is a date and time type.

Precautions for strings:

String in java is an object and a reference type. The difference between basic types and reference types is that basic types only represent simple characters or numbers, reference types can be any complex data structures, basic types only represent simple data types, and reference types can represent complex data types and manipulate the behavior of such data types.

Java virtual machines handle basic types differently from reference types. For basic types, java virtual machines allocate the memory space actually occupied by data types, while for reference type variables, it is just a pointer to an instance in the heap.