Java Classes

  Home  Java Programing  Java Classes


“Java Classes frequently Asked Questions in various Java Classes related job Interviews by interviewer. Get preparation of Java Classes job interview questions”



76 Java Classes Questions And Answers

72⟩ Explain when we are overloading or overriding the methods how we want to take care about the acess specifiers?

When we override a method in the child class, that method sould not be a private in parent class, but that method should be public or protected or default, those methods should have the same signature.

But we can overload the method within the same class or in the child class but they have some difference in having no of arguments or type of arguments. if we overload the method within the class we can use any access specifier, if we overload in child class dont use private.

 140 views

73⟩ What is enumeration?

public interface Enumeration . An object that implements the Enumeration interface generates a series of elements, one at a time. Successive calls to the nextElement method return successive elements of the series.

 131 views