Explain when we are overloading or overriding the methods how we want to take care about the acess specifiers?
Submitted by: AdministratorWhen 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.
Submitted by: Administrator
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.
Submitted by: Administrator
Read Online Java Classes Job Interview Questions And Answers
Top Java Classes Questions
☺ | Static and Non-Static are the two types of nested classes |
☺ | In this example class-var = new classname( ); |
☺ | Tell me Is it possible to declare an anonymous class while implementing an interface? |
☺ | It is possible to define a class within another class; such classes are known as ____________ |
☺ | in Java, all class objects need not be dynamically allocated |
Top Java Programming Language Categories
☺ | Core Java Interview Questions. |
☺ | Hibernate Interview Questions. |
☺ | Advanced Java Interview Questions. |
☺ | IBM WebSphere Interview Questions. |
☺ | Spring Framework Interview Questions. |