Java - Online Test - Reference - javasearch.buggybread.com


Share

Search Java Test Questions


 223 test questions in repository.




Java - Test Questions on 'Reference' - 5 questions found


Which of the following is not the use of this keyword ?Core Java
Passing itself to another method
To call the static method
Referring to the instance variable when local variable has the same name
Calling another constructor in constructor chaining

  this  this keyword  java

When String literals are compared using ==, they always returns true if the string values are same because .. Core Java
of overridden compareTo method
of overridden compare method
of String Pool
== means that the object contents are equal

  

What will be the output of following code ?

public class BuggyBread {

   private int x;

   private BuggyBread(int x){
      x = x;
   };

   public static void main(String[] args){
      BuggyBread buggybread = new BuggyBread(5);
      System.out.println(buggybread.x);
   }
}
Core Java
compilation error
undefined
0
5

  this keyword  coding  code

The following code is an example of

public class Car extends Vehicle{
   int x;

   Car(int y){
      x = 5;
   }

   Car(){
      this(5);
   }
}
Core Java
Constructor Overloading
Constructor Chaining
Both Constructor Overloading and Chaining
None of above

  constructor  constructor overloading  constructor chaining

Which of following is not true ?XML
Dom Parser loads the whole doument at once in memory
A DOM Parser is much more memory efficient
Dom Parser doesn't load the whole doument at once in memory
A SAX Parser is much more memory efficient

  xml  xml parsers







comments powered by Disqus