Select chapter



basics (7.papers)
constructors (1.papers)
packages (1.papers)
inheritance (7.papers)
misc (3.papers)
exceptions (5.papers)
threads (4.papers)
overloading (1.papers)
jsp (3.papers)
servlets (9.papers)
jdbc (2.papers)
util (1.papers)
xml (2.papers)
IO stream (3.papers)
Hide

Sponsored Links


  

java basics interview questions and answers

1
_________  hides data.
  1. Abstraction
  2. Encapsulation
  3. Grouping
  4. Inheritance
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
10
What is the result of attempting to compile and run this code

public class Test{
 int a;
 Test(){
  a++;
 }
 public static void main(String[] args){
  Test t = new Test();
  System.out.println("value = " t.a);
 }
}
  1. The code will compile and print as value=1
  2. The code will compile and print as value=0
  3. Compile time error as I is not initialised
  4. Runtime error
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
15
How does class provide data security?
  1. Encapsulation property of java ensures data secuirty for a class.
  2. By making a class as private will ensure the data security for a class.
  3. By moving all the data of a class into its methods will ensure the data security in java.
  4. Using private access modifier will assure the data security for a class.
Show Answer
Share Facebook gmail Twitter
Read more papers :