October 26, 2018

Srikaanth

WNS Global Most Frequently Asked Core Java Interview Questions Answers

What Are The Four Corner Stones Of Oop?

Abstraction, Encapsulation, Polymorphism and Inheritance.

What Gives Java It's "write Once And Run Anywhere" Nature?

Java is compiled to be a byte code which is the intermediate language between source code and machine code. This byte code is not platorm specific and hence can be fed to any platform. After being fed to the JVM, which is specific to a particular operating system, the code platform specific machine code is generated thus making java platform independent.

How Can A Dead Thread Be Restarted?

A dead thread cannot be restarted.

What Happens If An Exception Is Not Caught?

An uncaught exception results in the uncaughtException() method of the thread’s ThreadGroup being invoked, which eventually results in the termination of the program in which it is thrown.

What Is A Compilation Unit?

A compilation unit is a Java source code file.
WNS Global Most Frequently Asked Core Java Interview Questions Answers
WNS Global Most Frequently Asked Core Java Interview Questions Answers

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.

What Value Does Readline() Return When It Has Reached The End Of A File?

The readLine() method returns null when it has reached the end of a file.

Can An Object's Finalize() Method Be Invoked While It Is Reachable?

An object’s finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object’s finalize() method may be invoked by other objects.

Does Garbage Collection Guarantee That A Program Will Not Run Out Of Memory?

Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.

Is Sizeof A Keyword?

The sizeof operator is not a keyword.

What State Does A Thread Enter When It Terminates Its Processing?

When a thread terminates its processing, it enters the dead state.

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.

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.

What Is A Transient Variable?

transient variable is a variable that may not be serialized.

Wha Is The Output From System.out.println("hello"+null); ?

Hellonull.

What Are E And Pi?

E is the base of the natural logarithm and PI is mathematical value pi.

If An Object Is Garbage Collected, Can It Become Reachable Again?

Once an object is garbage collected, it ceases to exist. It can no longer become reachable again.

Can An Exception Be Rethrown?

Yes, an exception can be rethrown.

What Is The Purpose Of The File Class?

The File class is used to create objects that provide access to the files and directories of a local file system.

Is A Class Subclass Of Itself?

No. A class is not a subclass of itself.

What Modifiers May Be Used With An Interface Declaration?

An interface may be declared as public or abstract.

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.

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.

Subscribe to get more Posts :