Core java
Home Up Core java Core Java 2 Everything Else Core Java 3 Java Network Unanswered Questions

 

Java Interview Questions

Visit Java Interview Homepage

Next Page >>>

Q1. Describe the three OOO principles?

A1. Encapsulation - It is the way the code and data are confined and are in isolation from the

outside environment of the system.

EXAMPLE : In a car the engine can be thought about as an encapsulated which is controlled by the starter key and the gear. The operation of the engine does not affect the functioning of other parts of car like the headlight and wiper. In JAVA basis of encapsulation is the CLASS.

Inheritance - It is the process by which one object acquires the properties of another object.

Polymorphism - It is a feature that allows one interface to be used for a general class of actions. The specific action is determined by the exact nature of the situation.

EXAMPLE : In a college cafeteria if an old music is put the students would not like it , but if the latest number of Brittney Spears is put then they would love it. If analyzed then we can see that even though the process of listening is the same i.e. for the old song the students listen it from there ears and even for the latest Brittney Spears number they listen it from there ear. But there is a difference by which the students react. This difference can be explained by the concept polymorphism.



 

Q2. What is meant by Endianness?

A2. Endianness describes how multiple data types such as short , int and long are stored in memory.If it takes two bytes to represent a short, then to predict if the most significant or the least significant comes first.If the most significant byte is first, followed by the least significant one then the machine is said to be big endian. Machines such as the SPARC and Power PC are big-endian, while the Intel x86 series is little-endian.



 

Q3. How many types of literals are there in JAVA?

A3. There are four types of literals they are Integer literals, Floating point literals, Boolean literals and character literals.



 

Q4. A note on compiling & Executing a JAVA pgm

A4. (i) The name of the sourcefile is called in terms of .java

(ii) A source file is called a compilation unit. This has one or more class definitions.

(iii) The name of the class should be same as that of the file.

(iv) Once compiled the .java file creates a .class file. This is done by the compiler javac

(v) This classfile contains the bytecode version of the program.

Next Page >>>

Search this site for:

 

Please use this form to communicate any issues/problems with this website or its contents. If you find any content inappropriate for any reason, please let me know. Hit Counter