String s = "Hello"; means one object with value "Hello" will be created in the heap and reference variable s will refer to the object.but whenString s1 = s+"World";w...
Very tricky question.Asked me in Oracle interview for 4 years level of expHere is the answer: When JVM see the code where two three string objects has been added with + operator then it is using the S...
Class variable:? 1. Also called as static variable.2. Variable declared?in the class with static modifier.3. These variables are belong to the class.Instance variable:? 1. Variables declared in the class?without?the static modifier.2. These variables are belongs to the objects.
Tafazzul hasan
Feb 21st, 2007
Class variables belongs to a Classwhere as an instance variable belongs to an Object. A class variable is shared by all the objects of the class. where as every object contain their own instance variable.