Oracle Certified Professional, Java SE 7 Programmer (1Z0-803)
100% GUARANTEE of PASS
ALL CORRECT ANSWER!!

5 Sample Questions

public class Hat {
       public int ID =0;
       public String name = "hat";
       public String size = "One Size Fit All";
       public String color="";
       public String getName() { return name; }
       public void setName(String name) {
               this.name = name;
       }
}

public class TestHat {
       public static void main(String[] args) {
                Hat blackCowboyHat = new Hat();
       }
}
Which statement sets the name of the Hat instance?

  • A. blackCowboyHat.setName = "Cowboy Hat";
  • B. setName("Cowboy Hat");
  • C. Hat.setName("Cowboy Hat");
  • D. blackCowboyHat.setName("Cowboy Hat");

Which two are valid instantiations and initializations of a multi dimensional array?

A) int [] []  array2D = { { 0, 1, 2, 4, } ,  { 5, 6 } } ;

B) int [] [] array2D = new int [] [2] ;
     array2D [0] [0] = 1;
     array2D [0] [1] = 2;
     array2D [1] [0] = 3;
     array2D [1] [1] = 4;

C) int [] [] []  array3D =  {  { 0, 1 } , { 2, 3, } , { 4, 5 }  } ;

D) int [] array =  { 0 , 1 } ;
     int [] [] []   array3D  =  new int [2] [2] [2] ;
     array3D [0] [0]  =  array ;
     array3D [0] [1]  =  array ;
     array3D [1] [0]  =  array ;
     array3D [1] [1]  =  array ;

E) int [] []   array2D = { 0 , 1 } ;

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
  • E. Option E

A method doSomething () that has no exception handling code is modified
​to trail a method that throws a checked exception.

Which two modifications, made independently, will allow the program to compile?

  • A. Catch the exception in the method doSomething().
  • B. Declare the exception to be thrown in the doSomething() method signature.
  • C. Cast the exception to a RunTimeException in the doSomething() method.
  • D. Catch the exception in the method that calls doSomething().

class X {}
class Y { Y ( ) { } }
class Z { Z (int i ) { } }

Which class has a default constructor?

  • A. X only
  • B. Y only
  • C. Z only
  • D. X and Y
  • E. Y and Z
  • F. X and Z
  • G. X, Y and Z

Boolean b1 = true;
Boolean b2 = false;
int i = 0;
while (foo) { }

Which one is valid as a replacement for foo?

  • A. b1.compareTo(b2)
  • B. i = 1
  • C. i == 2? -1 : 0
  • D. "foo".equals("bar")