Top 1000+ Java Interview Questions and Answers Pdf - 2
Question: 6
Why are there no global variables in java?
Global variables are considered bad form for a variety of reasons: adding state variables breaks referential transparency, state variables lessen the cohesion of a program.
Question: 7
What is the use of bin and lib in JDK?
Bin contains all tools such as javac, appletviewer, awt tool etc. whereas lib contains API and all packages.
Question: 8
What is the difference between superclass and subclass?
A super class is a class that is inherited whereas subclass is a class that does the inheriting.
Question: 9
What is the difference between abstract class and interface?
All the methods declared inside an interface are abstract whereas abstract class must have at least one abstract method and others may be concrete or abstract.
In abstract class, keyword abstract must be used for the methods whereas interface we need not use that keyword for the methods.
Abstract class must have subclasses whereas interface can’t have subclasses.
Question: 10
Why Java does not support multiple inheritances?
Java design team stroke to make Java as
Simple, object oriented and familiar
Robust and secure
Architecture neutral and portable
High performance
Interpreted, threaded and dynamic
The reasons for omitting Multiple Inheritance from the Java Language mostly stem from the simple, object oriented and familiar goal.
- 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
Basic Electronics Quiz Questions with Answers Pdf More
Wireless Communication MCQ Questions with Answers More
Digital Communication Quiz Questions and Answers Pdf More
Advanced Communication Quiz Questions and Answers Pdf More
Synchronous Machines Quiz Questions and Answers Pdf More
10+ Odd One Out Picture Puzzles Questions with Answers More
Verbal Reasoning Questions for SSC, UPSC, CAT Exams More
Basic Computer Mcqs with Answers pdf More
6999+ System Programming MCQ with and Answers Pdf More
1,000+ Latest Puzzles for Bank Exams More