Java - Online Test - Default values - javasearch.buggybread.com


Share

Search Java Test Questions


 223 test questions in repository.




Java - Test Questions on 'default values' - 1 questions found


What will be the output of following ?

public class BuggyBread {

   private int x;
   private Integer y;

   BuggyBread(int x,int y){};

   public static void main(String[] args){
      BuggyBread buggybread = new BuggyBread(1,2);
      System.out.println(buggybread.x);
      System.out.println(buggybread.y);
   }
}
Core Java
0 0
0 null
null 0
null null

  default values







comments powered by Disqus