Skip to main content

Posts

Showing posts from April, 2017

Core Java Interview Questions

1) Explain run time polymorphism in Java ? Polymorphism can be explained as an object's ability to adapt to the program's context and take multiple forms. The method overriding is an example of run time polymorphism. You can have a method in a subclass, which overrides the method in its super classes with the same name and signature. At run time, Java virtual machine determines the appropriate method to be called. 2) What are the rules (method access permission and exception) that needs to be followed, during method overloading and overriding ? During method Overloading, method name should remain same. But method signature can vary. Components of signature that can vary are Number of arguments Datatype of arguments Order of arguments During method Overriding, make sure that the method is not throwing checked exceptions that are new or higher than those declared by the overridden method.But we can't override Static and Final methods. 3) What is the difference between an Inte...

Core Java Interview Question

1) Explain run time polymorphism in Java ? Polymorphism can be explained as an object's ability to adapt to the program's context and take multiple forms. The method overriding is an example of run time polymorphism. You can have a method in a subclass, which overrides the method in its super classes with the same name and signature. At run time, Java virtual machine determines the appropriate method to be called. 2) What are the rules (method access permission and exception) that needs to be followed, during method overloading and overriding ? During method Overloading, method name should remain same. But method signature can vary. Components of signature that can vary are Number of arguments Datatype of arguments Order of arguments During method Overriding, make sure that the method is not throwing checked exceptions that are new or higher than those declared by the overridden method.But we can't override Static and Final methods. 3) What is the difference between an Inte...