answersLogoWhite

0

A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.

A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.

A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.

A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
BeauBeau
You're doing better than you think!
Chat with Beau
More answers

A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.

User Avatar

Wiki User

15y ago
User Avatar

an object is stored in a heap in java

User Avatar

Wiki User

11y ago
User Avatar

Add your answer:

Earn +20 pts
Q: Where string is stored on Heap or Stack in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Sample of heap sort in java using string?

because of the gravity of the earth


In java is A string the same thing as a char?

No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.


Where do objects and references stored in memory in java?

Objects are stored in an area of memory called the "heap", whilst reference variables are stored in the "stack". These are both parts of the computer's RAM memory; the Java Virtual Machine (JVM) simply reserves part of the memory available to it for the stack and for the heap, and manages them accordingly.


In Java where do instance variables stored in memory?

An instance variable is part of an object. Therefore, it gets stored together with the object, on the heap. The heap is the part of memory which is used to store objects.An instance variable is part of an object. Therefore, it gets stored together with the object, on the heap. The heap is the part of memory which is used to store objects.An instance variable is part of an object. Therefore, it gets stored together with the object, on the heap. The heap is the part of memory which is used to store objects.An instance variable is part of an object. Therefore, it gets stored together with the object, on the heap. The heap is the part of memory which is used to store objects.


What are the steps to increase java heap space on a server?

You can specify the starting and maximum heap sizes when you launch a Java program by using the command line switches: -Xms<size> set initial Java heap size -Xmx<size> set maximum Java heap size Example: The following line will run the MyProgram Java program with 64-128mb heap space. java -Xms64m -Xmx128m MyProgram