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 interview questions and answers

Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
3
My.java file contains following class My {
class Star{} }
What is the result of compiling this file?
  1. My.class and My$Star.class gets created
  2. only My.class gets created
  3. Code will not compile
  4. only Star.class gets created
Show Answer
Share Facebook gmail Twitter
4
Consider the following code:
public class Sample
{ }
What should be the name of the java file?
  1. Sample.class
  2. Sample.java
  3. Any name with an extension of .java
  4. Insufficient information to answer this question
Show Answer
Share Facebook gmail Twitter
5
My.java file contains following class:
class Star{}
What is the result of compiling this file?
  1. Star.class gets created
  2. My.class gets created
  3. Code will not compile
  4. Both Star.class and My.class gets created
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
7
Which of the following commands requests system for garbage collection?
  1. System.free();
  2. System.garbageCollect();
  3. System.out.gc();
  4. System.gc();
Show Answer
Share Facebook gmail Twitter
8
String s; 
What can be said about the above statement at the minimum? This statement creates 
  1. an instance of String object
  2. a reference that points to null where ever it appears
  3. a reference that is not initialized where ever it appears
  4. a reference and nothing can be said about what it points to unless scope is known
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
16
After compiling a java class the compiler generates
  1. Machine code
  2. Byte code
  3. Exe file
  4. assembly code
Show Answer
Share Facebook gmail Twitter
17
Which of the following is not a valid declaration?
  1. int $x;
  2. int #123;
  3. int _123;
  4. int central_sales_region_Summer_2005_gross_sales;
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
19
Which of the following is documentation comment?
  1.  /* comment*/
  2.  /** comment */
  3.  //comment
  4.  /* comment **/
Show Answer
Share Facebook gmail Twitter
20
How JVM is related to JRE ?
  1. JRE is an instance of JVM which activates when a Java program is executed. 
  2. JVM is an instance of JRE which activates when a Java program is executed. 
  3. JRE and JVM are not related any way
  4. JVM includes JRE and some other library files
Show Answer
Share Facebook gmail Twitter
Read more papers :