Java Programming Interview Questions and Answers - 2
Question: 6
What is the use of interface?
An interface is a collection of public abstract methods and read only i.e. public, static and final variables. The concepts off interfaces in Java make Multiple Inheritance a reality. Two or more non related classes can implement the same interface,
A class can implement multiple interfaces.
Question: 7
What is public?
If we declare it as a public, classes, subclasses within the package and outside the package, can access it.
Question: 8
What is private?
It can’t be accessed anywhere other than the same class.
Question: 9
What restrictions are placed on method overriding?
Overridden methods must have the same name, argument list and return type.
The overriding method may not limit the access of the method it overrides.
The overriding method may not throw exceptions that may not be thrown by the overridden method.
Question: 10
What is final?
The final prevents its contents from being modified.
- 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
GATE Chemical Engineering Questions and Answers More
GATE 2024-2025 Question Paper Pdf Download More
Banking Awareness Questions 2024-2025 More
Computer Quiz Questions for Bank Exams More
Computer Quiz Questions for Bank Exams More
General Scientific Laws Inventions and Discoveries in Physics Pdf More
Windows Explorer Quiz Questions and Answers More
Computer Science Quiz Questions with Answers Multiple Choice 2019-2020 More
Inventions and Discoveries General Knowledge Questions and Answers More
1000+ NAB Aptitude Test Questions and Answers More