Type Here to Get Search Results !

CORE JAVA IMPORTANT QUESTIONS - Part 5

0

 CORE JAVA IMPORTANT QUESTIONS 

Part 5


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. What is the catch or declare rule for method declarations?

If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause.

Q2. What is the difference between a MenuItem and a CheckboxMenuItem?

The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked.

Q3. What is a task's priority and how is it used in scheduling?

A task's priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks.


Q4. What class is the top of the AWT event hierarchy?

The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy.

Q5. When a thread is created and started, what is its initial state?

A thread is in the ready state after it has been created and started.

Q6. Can an anonymous class be declared as implementing an interface and extending a class?

An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.


Q7. What is the range of the short type?

The range of the short type is -(2^15) to 2^15 - 1.

Q8. What is the range of the char type?

The range of the char type is 0 to 2^16 - 1.

Q9. In which package are most of the AWT events that support the event-delegation model defined?

Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package. The AWTEvent class is defined in the java.awt package.


Q10. What is the immediate superclass of Menu?

MenuItem

Q11. What is the purpose of finalization?

The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.

Q12. Which class is the immediate superclass of the MenuComponent class.

Object


Q13. What invokes a thread's run() method?

After a thread is started, via its start() method or that of the Thread class, the JVM invokes the thread's run() method when the thread is initially executed.

Q14. What is the difference between the Boolean & operator and the && operator?

If an expression  involving the Boolean & operator is  evaluated, both operands are  evaluated. Then the & operator is applied to the operand. When an expression involving the

&& operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The && operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand    is skipped.

Q15. Name three subclasses of the Component class.

Box.Filler, Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar, or TextComponent





Post a Comment

0 Comments

Top Post Ad

Below Post Ad