Tag Archives: java interview questions

java-questions-4

1 Which one of the following represents legal flow control statements? a. break; b. break(); c. continue(inner); d. exit();   2. Predict the output from below java program.

Options: A. Got the exception 10 B. Go the exception 0 C. Compile time error D. Run-time error   3. Output of below java program.

Read More »

encapsulation in java

Encapsulation in java: Encapsulation = Data Hiding + Abstraction. It means if any component is following Abstraction as well as data hiding then it is also following Encapsulation. Encapsulation: It is actually the process of binding data members and methods together in a unit. Each class in java itself is an example of encapsulation. It… Read More »