How many bytes in memory a string occupy in Java language?

Discussion in 'HTML en webdesign' started by Nolan1, Nov 28, 2014.

  1. Nolan1

    Nolan1 New Member

    Joined:
    Nov 18, 2014
    Messages:
    12
    Likes Received:
    1
    How many bytes in memory a string occupy in Java language?
    Suppose i write:
    String name="Bill Gates";
    So, how much memory it requires? Whether it can store a UNICODE character in the string. How internally it is implemented, using a 1 byte char array or 2 byte unicode char array? I read somewhere that Java's char data type is 16 bit wide.

    Thanks!!!
     

Share This Page

Loading...