Answer» - String in C: In C, strings are just arrays of characters, and they are terminated with a /0, which is why we commonly refer to them as "null-terminated". Strings in C, like "ABC$%", actually consist of 6 characters 'a' 'b' 'c' '$' '%' and '/0', but these can be EASILY manipulated.
- String in Java: Java treats Strings as objects, not arrays. String objects are created using the java.lang.String CLASS. String objects in Java are immutable; you cannot modify their contents. This means whenever we manipulate a String object, the new String is created rather than the original string being modified.
|