CORE JAVA IMPORTANT QUESTIONS
Part 8
Java is one of the most popular programming language. There is a growing demand for Java Developer jobs in technology companies.
This article contains technical most important core java questions that an interviewer asks for Java technology and related topics. Each question is accompanied with an answer so that you can prepare for job interview and clear your concepts in short time.
we have covered almost 500+ important core Java interview questions for freshers and experienced candidates. This post on CORE JAVA Important Questions is prepared to help you understand the basic concepts of Java programming for interview purposes. All the important JAVA concepts are explained here with examples for your easy understanding.This tutorial covers JAVA topics like basic Java definitions, OOP concepts, Access specifiers, Collections, Exceptions, Threads, Serialization, etc., with examples to make you get ready perfectly to face any JAVA interview confidently.
All the best !
Q1. When can an object reference be cast to an interface reference?
An object reference be cast to an interface reference when the object implements the referenced interface.
Q2. What is the difference between a Window and a Frame?
The Frame class extends Window to define a main application window that can have a menu bar.
Q3. Which class is extended by all other classes?
The Object class is extended by all other classes.
Q4. Can an object be garbage collected while it is still reachable?
A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected..
Q5. Is the ternary operator written x : y ? z or x ? y : z ?
It is written x ? y : z.
Q6. What is the difference between the Font and FontMetrics classes?
The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object.
Q7. How is rounding performed under integer division?
The fractional part of the result is truncated. This is known as rounding toward zero.
Q8. What happens when a thread cannot acquire a lock on an object?
If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available.
Q9. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
The Reader/Writer class hierarchy is character-oriented, and the InputStream/ OutputStream class hierarchy is byte-oriented.
Q10. What classes of exceptions may be caught by a catch clause?
A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Error and Exception types.
Q11. If a class is declared without any access modifiers, where may the class be accessed?
A class that is declared without any access modifiers is said to have package access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.
Q12. What is the SimpleTimeZone class?
The SimpleTimeZone class provides support for a Gregorian calendar.
Q13. What is the Map interface?
The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys with values.
Q14. Does a class inherit the constructors of its superclass?
A class does not inherit constructors from any of its superclasses.
Q15. For which statements does it make sense to use a label?
The only statements for which it makes sense to use a label are those statements that can enclose a break or continue statement.
Recommended Posts
Core Java Important Questions Part 1
Core Java Important Questions Part 2
Core Java Important Questions Part 3
Core Java Important Questions Part 4
Core Java Important Questions Part 5
Core Java Important Questions Part 6
Core Java Important Questions Part 7
Core Java Important Questions Part 9
Core Java Important Questions Part 10
Java Collections Interview Questions Part 1
Java Collections Interview Questions Part 2
Java Collections Interview Questions Part 3
Java MCQs with Answers Set III
If you have any doubts join the discussion below ,our Moderator will reply to your Queries