- that's what it says further up that page. But you are right, the table does include the String, (object), and it goes on to explain it thusly:

"The String class is not technically a primitive data type, but considering the special support given to it by the language, you'll probably tend to think of it as such. You'll learn more about the String class in Simple Data Objects"

I've read that page in the past many times, and I'd say,personally, that I have big doubts as to how helpful that explanation is about String. Because unless you unpick a String by calling .charSequence() on it, then you will always be working with an Object.

How immutability related to getting to its components chars. I am not clear on this point. Please advise

They are not related as such - it just means that a String, once defined, stays how it was when it was made. If you want to get individual characters from it, (for whatever reason) then you can obtain discrete chars, that's about it.

>>Table in this link lists String also under heading of
Primitive Data Types<<
Actually, it lists String(or any object) as a data type, but doesn't include String in the definitions of primitive data types.
As for immutability, try this little test.
String s = "Java";
s.concat(" is fun");
sysout_println(s);

krakatoa,
My response wasn't really directed to you, but trying to provide an example of how strings are immutable.
The idea of "re-assigning" a new value to a string (i.e. making a new String as in your example) can also be used to circumvent the immutablity feature of Strings -
String s = "Java"
s = s.concat(" is fun");

That's what I was trying to say that once it's "re-assigned", it becomes a new string and your statement that the String "Java" no longer exists further clarifies that the immutability can not really be circumvented. Thanks.

class St{public static void main(String[] args){ String s = "Java"; s.concat(" is fun."); //the next line simply prints "Java" System.out.println(s); s = s.concat(" is fun."); //the next line prints "Java is fun." System.out.println(s); //the next line prints "Java is fun. is fun." System.out.println(s.concat(new String(new char[]{' ','i','s',' ','f','u','n','.'}))); //the next line prints "Java is fun." s is NOT equal to "Java is fun. is fun.", but IS still equal to "Java is fun." // because s has not been re-allocated to a new String, as it was first time 'round. System.out.println(s); CharSequence c =s.subSequence(0,s.length()); // this line prints out String s as a sequence of chars for (int a=0;a<c.length();a++){System.out.println(c.charAt(a));} // this line prints a concatenation of "Java is fun." and " is fun." System.out.println(s.concat(new String(new char[]{' ','i','s',' ','f','u','n','.'}))); // this line prints "Java is fun." again. System.out.println(s = new String(s)); // this prints "Java is fun. is fun." System.out.println(s.concat(" is fun.")); //BUT s.concat(" is fun."); System.out.println(s); //has just printed only "Java is fun." //WHEREAS THIS s = s + " is fun."; System.out.println(s); //prints "Java is fun. is fun."}}

Viewers will learn about the different types of variables in Java and how to declare them.
Decide the type of variable desired:
Put the keyword corresponding to the type of variable in front of the variable name:
Use the equal sign to assign a v…