Computer Applications
A static class method can be invoked by simply using the name of the method alone. (True/False)
User Defined Methods
2 Likes
Answer
False
Reason — A method declared as static can be invoked by using the syntax <class name>.<method name>. For example, in Math.pow() function, Math is the name of the class and pow() is its static function.
Answered By
1 Like
Related Questions
Members of a class specified as private are accessible only to the methods of the class. (True/False)
A method declared as static cannot access non-static class members. (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) { }
What is the role of void keyword in declaring functions ?