1Z0-803 | Up to the immediate present 1Z0-803 Exam Study Guides With New Update Exam Questions


Q61. Given: 

Which two modifications are necessary to ensure that the class is being properly encapsulated? 

The class is poorly encapsulated. You need to change the circle class to compute and return the area instead. 

A. Remove the area field. 

B. Change the getArea( ) method as follows: public double getArea ( ) { return Match.PI * radius * radius; } 

C. Add the following method: public double getArea ( ) {area = Match.PI * radius * radius; } 

D. Change the cacess modifier of the SerRadius ( ) method to be protected. 

Answer: BD 

Q62. Given: 

public class MainMethod { 

void main() { 

System.out.println("one"); 

static void main(String args) { 

System.out.println("two"); 

public static void main(String[] args) { 

System.out.println("three"); 

void mina(Object[] args) { 

System.out.println("four"); 

What is printed out when the program is excuted? 

A. one 

B. two 

C. three 

D. four 

Answer:

Q63. Given the code fragment:  

A. Found Red 

Found Default 

B. Found Teal 

C. Found Red 

Found Blue 

Found Teal 

D. Found Red 

Found Blue 

Found Teal 

Found Default 

E. Found Default 

Answer:

Q64. public class DoBreak1 { 

public static void main(String[] args) { 

String[] table = {"aa", "bb", "cc", "dd"}; 

for (String ss: table) { 

if ( "bb".equals(ss)) { 

continue; 

System.out.println(ss); 

if ( "cc".equals(ss)) { 

break; 

What is the result? 

A. aa 

B. aa bb  cc 

C. cc dd 

D. cc 

E. Compilation fails. 

Answer:

Q65. Which two statements are true for a two-dimensional array of primitive data type? 

A. It cannot contain elements of different types. 

B. The length of each dimension must be the same. 

C. At the declaration time, the number of elements of the array in each dimension must be 

specified. 

D. All methods of the class object may be invoked on the two-dimensional array. 

Answer: CD 

Q66. Given: 

What is the result? 

A. hEllOjAvA! 

B. Hello java! 

C. Out of limits hEllOjAvA! 

D. Out of limits 

Answer:

Q67. Given the code fragment: 

Which statement is true? 

A. After line 8, three objects are eligible for garbage collection 

B. After line 8, two objects are eligible for garbage collection 

C. After line 8, one object is eligible for garbage collection 

D. After line 8, none of the objects are eligible for garbage collection 

Answer:

Q68. Given: 

Which approach ensures that the class can be compiled and run? 

A. Put the throw new Exception() statement in the try block of try – catch 

B. Put the doSomethingElse() method in the try block of a try – catch 

C. Put the doSomething() method in the try block of a try – catch 

D. Put the doSomething() method and the doSomethingElse() method in the try block of a try – catch 

Answer:

Q69. You are writing a method that is declared not to return a value. Which two are permitted in 

the method body? 

A. omission of the return statement 

B. return null; 

C. return void; 

D. return; 

Answer: AD 

Q70. Given: 

What is the result? 

A. 6 5 6 4 

B. 6 5 5 4 

C. 6 5 6 6 

D. 6 5 6 5 

Answer: