Computer Applications
Differentiate between static data members and non-static data members.
Java Classes
ICSE 2010
89 Likes
Answer
Static Data Members | Non-Static Data Members |
---|---|
They are declared using keyword 'static'. | They are declared without using keyword 'static'. |
All objects of a class share the same copy of Static data members. | Each object of the class gets its own copy of Non-Static data members. |
They can be accessed using the class name or object. | They can be accessed only through an object of the class. |
Answered By
47 Likes
Related Questions
Which of the following declarations are illegal and why?
(a) class abc{…}
(b) public class NumberOfDaysWorked{…}
(c) private int x;
(d) private class abc{…}
(e) default key getkey(…)Why can't every class be termed as user defined data type?
Differentiate between private and protected visibility modifiers.
Differentiate between instance variable and class variable.