Java Interview Questions and Answers for Freshers Pdf - 2
Question: 6
What are the rules we have to follow in overloading?
The number of arguments must be different.
The type of arguments must be different
It will not depend on return type.
Question: 7
What is an abstract method?
An abstract method is a method whose implementation is deferred to a sub class.
Question: 8
What is the difference between an abstract class and an interface?
An abstract class allows its subclasses to override the methods defined in it.
It is never instantiated and a class can inherit from a single class, as Java doesn’t support for Multiple Inheritance.
It may contain both abstract and non abstract methods.
An interface has public, abstract methods and may have public, static and final variables.
It introduces multiple inheritance by a class implementing several interfaces.
Question: 9
What is the difference between an argument and a parameter?
While defining method, variables passed in the method are called parameters.
While using those methods, value passed to those variables are called arguments.
Question: 10
What is the difference between overloading and overriding?
In overloading, there is a relationship between methods available in the same class whereas in overriding, there is relationship between a superclass method and subclass method.
Overloading does not block inheritance from the superclass whereas overriding blocks inheritance from the superclass.
In overloading, separate methods are same name whereas in overriding, subclass method replaces the superclass.
- Java Interview Questions and Answers
- Top 1000+ Java Interview Questions and Answers Pdf
- Top 500+ Advanced Java Interview Questions 2020-2021
- Java Interview Questions and Answers for Freshers Pdf
- Java Interview Questions and Answers for Experienced Pdf
- Java Programming Basics Interview Questions
- Java OOPS Interview Questions for 3 years experienced
- Basic Java Programs Asked in Interview with Answers Pdf
- Java Programming Interview Questions and Answers
- C | C++ | Java Interview Questions and Answers
Power Semiconductor Device and Integrated Circuits Questions More
Strength of Materials Questions and Answers Pdf More
Steam and Power Generation Quiz Questions & Answers Pdf More
Dc generator questions and answers pdf More
DC Generator Questions and Answers Pdf More
100+ Percentage Questions with Solutions Pdf More
1000+ Petroleum Production Engineering Interview Questions More
1000+ Business Management MCQ Questions and Answers More
100+ Probability Questions for Bank PO, SO, Clerk Exams More
Computer Instructor Question Paper Pdf More