Type Here to Get Search Results !

CORE JAVA IMPORTANT QUESTIONS - Part 2

1

 CORE JAVA IMPORTANT QUESTIONS

Part - 2


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 a resource bundle?

In its simplest form, a resource bundle is represented by a text file containing keys and a text value for each key


Q2. What is transient variable?

Transient variable can't be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can't be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable becomes null.


Q3. What is Collection API?

The Collection API is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces.

Example of classes: HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap.

Example of interfaces: Collection, Set, List and Map.


Q4.Is Iterator a Class or Interface? What is its use?

Iterator is an interface which is used to step through the elements of a Collection.


Q5. What is similarities/difference between an Abstract class and Interface?

The differences are as follows:

Interfaces provide a form of multiple inheritance. A class can extend only one other class.

Interfaces are limited to public methods and constants with no implementation. Abstract classes can have a partial implementation, protected parts, static methods, etc.

A Class may implement several interfaces. But in case of abstract class, a class may extend only one abstract class.

Interfaces are slow as it requires extra indirection to to find corresponding method in in the actual class. Abstract classes are fast.

Similarities:

Neither Abstract classes or Interface can be instantiated.


Q6. What is a transient variable?

A transient variable is a variable that may not be serialized.


Q7. Which containers use a border Layout as their default layout?

The window, Frame and Dialog classes use a border layout as their default layout.


Q8. Why do threads block on I/O?

Threads block on i/o (that is enters the waiting state) so that other threads may execute while the i/o Operation is performed.


Q9. How are Observer and Observable used?

Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.


Q10. What is synchronization and why is it important?

With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that   object's value. This often leads to significant errors.


Q11. Can a lock be acquired on a class?

Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.


Q12. What's new with the stop(), suspend() and resume() methods in JDK 1.2?

The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.


Q13. Is null a keyword?

The null value is not a keyword.


Q14. What is the preferred size of a component?

The preferred size of a component is the minimum component size that will allow the component to display normally.


Q15. What method is used to specify a container's layout?

The setLayout() method is used to specify a container's layout.



Post a Comment

1 Comments
  1. It's only over the course of an absolutely Titanic-sized number of turns that the https://thekingofdealer.com/solaire-casino/ casinos are getting their payout numbers. Unless you propose on making a career out of risking your money, there isn't any level in letting it issue into your decisions. Sure, casinos make use of a sure stage of technique in inserting their slots, but each varies and it isn't something so simple as|as easy as} to be understood with a quick glance or paragraph. What's extra, with technology these days, they will change a machine's payout at the click of the button. So before you go asking that cute hostess the place you must to} play, assume again.

    ReplyDelete
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Top Post Ad

Below Post Ad