adplus-dvertising
frame-decoration

Question

Which of the following statements is correct?

a.

Public method is accessible to all other classes in the hierarchy

b.

Public method is accessible only to subclasses of its parent class

c.

Public method can only be called by object of its class

d.

Public method can be accessed by calling object of the public class

Answer: (a).Public method is accessible to all other classes in the hierarchy

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following statements is correct?

Similar Questions

Discover Related MCQs

Q. What is the return type of a method that does not return any value?

Q. What is the process of defining more than one method in a class differentiated by method signature?

Q. Which of the following is a method having same name as that of it’s class?

Q. Which method can be defined only once in a program?

Q. Which keyword is used by the method to refer to the object that invoked it?

Q. Which of the following is a method having same name as that of its class?

Q. Which operator is used by Java run time implementations to free the memory of an object when it is no longer needed?

Q. Which function is used to perform some action when the object is to be destroyed?

Q. What is true about private constructor?

Q. What would be the behaviour if this() and super() used in a method?

Q. What is false about constructor?

Q. What is true about Class.getInstance()?

Q. What is true about constructor?

Q. Abstract class cannot have a constructor.

Q. What is true about protected constructor?

Q. What is not the use of “this” keyword in Java?

Q. What would be the behaviour if one parameterized constructor is explicitly defined?

Q. What would be behaviour if the constructor has a return type?

Q. Which of the following has the highest memory requirement?

Q. Where is a new object allocated memory?