Computer Applications
A method declared as static cannot access non-static class members. (True/False)
User Defined Methods
2 Likes
Answer
True
Reason — A method declared as static can only access static class members.
Answered By
2 Likes
Related Questions
We can overload methods with differences only in their return type. (True/False)
Members of a class specified as private are accessible only to the methods of the class. (True/False)
A static class method can be invoked by simply using the name of the method alone. (True/False)
Which of the following function-definitions are overloading the method given below :
int sum(int x, int y) {}- int sum(int x, int y, int z) { }
- float sum(int x, int y) { }
- int sum (float x, float y) { }
- int sum (int a, int b) { }
- float sum(int x, int y, float z) { }