How many bytes is a string in java?



How many bytes is a string in java?..

Answer / Mohammad Arshad

In Java, the length of a string can vary as it is an object and not a primitive data type. However, each character in a string occupies 2 bytes (assuming UTF-16 encoding).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is gc()?

1 Answers  


Is there any need to import java.lang package?

13 Answers   Sun Microsystems,


What is basic concept of static in java ?

1 Answers   iGate,


What is Enum in Java?

1 Answers  


Can a double value be cast to a byte?

3 Answers  


Is empty list java?

1 Answers  


what is the difference between pagecontext and servletcontext?

5 Answers   JBA Infotech, TCS,


When is the finalize() called? What is the purpose of finalization?

1 Answers  


Write a code to create a trigger to call a stored procedure

1 Answers  


explain System.out.println

107 Answers   Calpine Technologies, Care, Cognizant, CTS, IBM, IBS, LibSys, Oracle, Spiro Solutions, TCS,


What is data type in computer?

1 Answers  


Can we execute a program without main() method?

1 Answers  


Categories