+ 4
Is there any difference between data members and instance variables in java ???
5 Answers
+ 2
data members are the variables written within the specific method and can only be used in that method,where as the instance variables or global variables are declared before declaring a method and can be called and used anywhere in the program.
+ 3
thanx @ Ujjwal Lenka
+ 2
eg for instance variable:-
class ABC
{ int a;
int b;
void function ()
{
}
these are declared in class block...not in the method block.......
and for data members I am not clear in its definition.
+ 2
welcome
hope the answer was helpful âș
0
Can you provide example?