(array & string) Difference in Java vs. C -


I know about C and I am entering Java and about its approach to array and string is confused. It is completely different from the arrays and strings in C. Please help me understand what is really the difference between C and Java (strings and arrays). In C, a string is usually just an array (or an indicator) character, a NUL (\ "\", \ n \ 0) ends with the letter. You can process a string because you will process any array.

In Java, however, there are no string array Java strings are the examples (objects) of the class that they represent character data, but the internal implementation of the programmer Not in front of you, you can not consider them as an array, although, if necessary, you can remove the straight data as an array of bytes or characters (methods getBytes and GetChars ). Also keep in mind that Java characters are 16-bit, always, while the characters in C are usually (not always) 8-bit.


Comments