[Premium](100% Valid) Passing Oracle 1Z0-803 Exam By The Help Of Passleader Free 1Z0-803 Practice Tests (16-30)
Info For 1Z0-803 Exam 100% Pass: PassLeader provides you with the newest 1Z0-803 exam questions updated in recent days to prepare your 1Z0-803 certification exams. Our best 1Z0-803 exam dumps will offer you the newest questions and answers with premium VCE and PDF format to download. And PassLeader also offer you the latest free version VCE Player! Vendor: Oracle Exam Code: 1Z0-803 Exam Name: Java SE 7 Programmer I QUESTION 16 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(). Answer: AB QUESTION 17 Given the code fragment: String color = "Red"; switch(color) { case "Red": System.out.println("Found Red"); case "Blue": System.out.println("Found Blue"); break; case "White": System.out.println("Found White"); break; default: System.out.println("Found Default"); } What is the result? A. Found Red B. Found Red Found Blue C. Found Red Found Blue Found White D. Found Red Found Blue Found White Found Default Answer: B QUESTION 18 Which two may precede the word "class" in a class declaration? A. local B. public C. static D. volatile E. synchronized Answer: BC QUESTION 19 Which three are bad practices? A. Checking for ArrayindexoutofBoundsException when iterating through an array to determinewhen all elements have been visited B. Checking for Error and. If necessary, restartingthe program to ensure that users are unaware problems C. Checking for FileNotFoundException to inform a user that a filename entered is not valid D. Checking for ArrayIndexoutofBoundsExcepcion and ensuring that the program can recover if one occur E. Checking for an IOException and ensuring that the program can recover if one occurs Answer: ABD QUESTION 20 Given: public class Bark { // Insert code here - Line 5 public abstract void bark(); // Line 6 } // Line 7 // Line 8 // Insert code here - Line 9 public void bark() { System.out.println("woof"); } } What code should be inserted? A. 5.class Dog { 9. public class Poodle extends Dog { B. 5.abstract Dog { 9. public class poodle extends Dog { C. 5.abstractclassDog { 9. public class Poodle extends Dog { D. 5.abstract Dog { 9.public class Poodle implements Dog { E. 5. abstractDog { 9. public class Poodle implements Dog { F. 5.abstract class Dog { 9.public class Poodle implements Dog { Answer: C QUESTION 21 Given: 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 Answer: A QUESTION 22 Given: Public static void main (String [] args) { int a, b, c = 0; int a, b, c; int g, int h, int i, = 0; int d, e, F; int k, l, m; = 0; Which two declarations will compile? A. int a, b, c = 0; B. int a, b, c; C. int g, int h, int i = 0; D. int d, e, F; E. int k, l, m = 0; Answer: AD QUESTION 23 Given the code fragment: int j=0, k =0; for (int i=0; i < x; i++) { do { k=0; while (k < z) { k++; System.out.print(k + " "); } System.out.println(" "); j++; } while (j< y); System.out.println("----"); } What values of x, y, z will produce the following result? 1 2 3 4 1 2 3 4 1 2 3 4 ------ 1 2 3 4 ------ A. X = 4, Y = 3, Z = 2 B. X = 3, Y = 2, Z = 3 C. X = 2, Y = 3, Z = 3 D. X = 4, Y = 2, Z= 3 E. X = 2, Y = 3, Z = 4 Answer: E http://www.passleader.com/1z0-803.html QUESTION 24 Which statement initializes a stringBuilder to a capacity of 128? A. StringBuildersb = new String("128"); B. StringBuildersb = StringBuilder.setCapacity(128); C. StringBuildersb = StringBuilder.getInstance(128); D. StringBuildersb = new StringBuilder(128); Answer: D QUESTION 25 Given: public class DoCompare4 { public static void main(String[] args) { String[] table = {"aa", "bb", "cc"}; int ii =0; do while (ii < table.length) System.out.println(ii++); while (ii < table.length); } } What is the result? A. 0 B. 0 1 2 C. 0 1 2 0 1 2 0 1 2 D. Compilation fails Answer: B QUESTION 26 A method is declared to take three arguments. A program calls this method and passes only two arguments. What is the result? A. Compilation fails. B. The third argument is given the value null. C. The third argument is given the value void. D. The third argument is given the value zero. E. The third argument is given the appropriate false value for its declared type. F. An exception occurs when the method attempts to access the third argument. Answer: A QUESTION 27 Given the fragment: int [] array = {1, 2, 3, 4, 5}; System.arraycopy (array, 2, array, 1, 2); System.out.print (array [1]); System.out.print (array[4]); What is the result? A. 14 B. 15 C. 24 D. 25 E. 34 F. 35 Answer: F QUESTION 28 Given the following code fragment: if (value >= 0) { if (value != 0) System.out.print("the "); else System.out.print("quick "); if (value < 10) System.out.print("brown "); if (value > 30) System.out.print("fox "); else if (value < 50) System.out.print("jumps "); else if (value < 10) System.out.print("over "); else System.out.print("the "); if (value > 10) System.out.print("lazy "); } else { System.out.print("dog "); } System.out.print("... "); } What is the result if the integer value is 33? A. The fox jump lazy... B. The fox lazy... C. Quick fox over lazy ... D. Quick fox the .... Answer: B QUESTION 29 Which three are advantages of the Java exception mechanism? A. Improves the program structure because the error handling code is separated from the normal program function B. Provides a set of standard exceptions that covers all the possible errors C. Improves the program structure because the programmer can choose where to handle exceptions D. Improves the program structure because exceptions must be handled in the method in which they occurred E. allows the creation of new exceptions that are tailored to the particular program being Answer: ACE QUESTION 30 Given the code fragment: Boolean b1 = true; Boolean b2 = false; int 1 = 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") Answer: D http://www.passleader.com/1z0-803.html
|