I have doubt that what we are using in java as String, is it class or datatype?
String str = "hello"
String s1 = new String("Hi")
What is the difference in above two statements?
Which is object of String class and which is varialble of datatype String?
Because as i know, there are String class also and we are using different methods like toUpperCase, toLowerCase, subString, CompareTo, equals etc.....
So, how java differentiate between class object and variable?
Thanks