Thursday, February 22, 2007

Java Interview Questions- Part1

Java Language Questions

--------------------------------------------------------------------------------

What is a platform?
A platform is the hardware or software environment in which a program runs. Most platforms can be described as a combination of the operating system and hardware, like Windows 2000/XP, Linux, Solaris, and MacOS.


--------------------------------------------------------------------------------

What is the main difference between Java platform and other platforms?
The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms.

The Java platform has two components:

The Java Virtual Machine (Java VM)
The Java Application Programming Interface (Java API)

--------------------------------------------------------------------------------

What is the Java Virtual Machine?
The Java Virtual Machine is a software that can be ported onto various hardware-based platforms.


--------------------------------------------------------------------------------

What is the Java API?
The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets.


--------------------------------------------------------------------------------

What is the package?
The package is a Java namespace or part of Java libraries. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages.


--------------------------------------------------------------------------------

What is native code?
The native code is code that after you compile it, the compiled code runs on a specific hardware platform.


--------------------------------------------------------------------------------

Is Java code slower than native code?
Not really. As a platform-independent environment, the Java platform can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time bytecode compilers can bring performance close to that of native code without threatening portability.


--------------------------------------------------------------------------------

What is the serialization?
The serialization is a kind of mechanism that makes a class or a bean persistence by having its properties or fields and state information saved and restored to and from storage.


--------------------------------------------------------------------------------

How to make a class or a bean serializable?
By implementing either the java.io.Serializable interface, or the java.io.Externalizable interface. As long as one class in a class's inheritance hierarchy implements Serializable or Externalizable, that class is serializable.


--------------------------------------------------------------------------------

How many methods in the Serializable interface?
There is no method in the Serializable interface. The Serializable interface acts as a marker, telling the object serialization tools that your class is serializable.


--------------------------------------------------------------------------------

.

No comments: