If I write this in Java:
String s = "abc";
Does s only occupy 3 bytes in the memory?
If true, how JVM finds the end of the String object?
Does this take more bytes in memory?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It takes more than 3 bytes, read on for full explanation from this page
This page from the same website also details ways in which you can save memory using classes different than
String