1Z0-803 | Improved 1Z0-803 Exam Study Guides With New Update Exam Questions


Q81. Which declaration initializes a boolean variable? 

A. boolean h = 1; 

B. boolean k = 0; 

C. boolean m = null; 

D. boolean j = (1 < 5); 

Answer:

Q82. 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 

Q83. What is the result? 

A. Hello 

B. Default 

C. Compilation fails 

D. The program prints nothing 

E. An exception is thrown at run time 

Answer:

Q84. Given: 

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 

Q85. Given the code fragment: 

Which code fragment, when inserted at // insert code here, enables the code to compile and and print a b c? 

A. List update (String[] strs) 

B. Static ArrayListupdate(String [] strs) 

C. Static List update (String [] strs) 

D. Static void update (String[] strs) 

E. ArrayList static update(String [] strs) 

Answer:

Q86. View the Exhibit. 

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; 

Given 

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"); 

Answer:

Q87. Int [] [] array = {{0}, {0, 1}, {0, 2, 4}, {0, 3, 6, 9}, {0, 4, 8, 12, 16}}; 

Systemout.printIn(array [4] [1]); 

System.out.printIn (array) [1] [4]); 

What is the result? 

A. 4 Null 

B. Null 4 

C. An IllegalArgumentException is thrown at run time 

D. 4 An ArrayIndexOutOfBoundException is thrown at run time 

Answer:

Q88. Given the following code: 

What will make this code compile and run? 

A. Change line 2 to the following: 

Public int price 

B. Change line 4 to the following: 

int price = new simple (); 

C. Change line 4 to the following: 

Float price = new simple (); 

D. Change line 5 to the following: 

Price = 4f; 

E. Change line 5 to the following: 

price.price = 4; 

F. Change line 5 to the following: 

Price = (float) 4: 

G. Change line 5 to the following: 

Price = (Simple) 4; 

H. The code compiles and runs properly; no changes are necessary 

Answer:

Q89. public class StringReplace { 

public static void main(String[] args) { 

String message = "Hi everyone!"; 

System.out.println("message = " + message.replace("e", "X")); } 

What is the result? 

A. message = Hi everyone! 

B. message = Hi XvXryonX! 

C. A compile time error is produced. 

D. A runtime error is produced. 

E. message = 

F. message = Hi Xveryone! 

Answer:

Q90. Given: 

What is the result? 

A. 1 1 1 

B. 1 2 3 

C. 2 3 4 

D. Compilation fails 

E. The loop executes infinite times 

Answer: