♥♥ 2021 NEW RECOMMEND ♥♥
Free VCE & PDF File for Oracle 1Z0-803 Real Exam (Full Version!)
★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions
Free Instant Download NEW 1Z0-803 Exam Dumps (PDF & VCE):
Available on:
http://www.surepassexam.com/1Z0-803-exam-dumps.html
Q31. What is result?
A. Successful
B. Unsuccessful
C. Compilation fails
D. An exception is thrown at runtime
Answer: C
Q32. Given:
What is the result?
A. Compilation fails
B. The code compiles, but does not execute.
C. Paildrome
D. Wow
E. Mom
Answer: B
Q33. 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: C
Q34. What is the result?
A. Initialized
Started
B. Initialized
Started
Initialized
C. Compilation fails
D. An exception is thrown at runtime
Answer: B
Q35. Given:
What three modifications are necessary to ensure that the class is being properly encapsulated?
This class is poorly encapsulated. You need to change the circle class to compute and return the area instead.
A. Change the access modifier of the setradius () method to private
B. Change the getArea () method public double getArea () { return area; }
C. When the radius is set in the Circle constructor and the setRadius () method, recomputed the area and store it into the area field
D. Change the getRadius () method:
public double getRadius () {
area = Math.PI * radius * radius;
return radius;
}
Answer: BCD
Q36. Given the code fragment:
String name = "Spot";
int age = 4;
String str ="My dog " + name + " is " + age;
System.out.println(str);
And
StringBuilder sb = new StringBuilder();
Using StringBuilder, which code fragment is the best potion to build and print the following
string My dog Spot is 4
A. sb.append("My dog " + name + " is " + age); System.out.println(sb);
B. sb.insert("My dog ").append( name + " is " + age); System.out.println(sb);
C. sb.insert("My dog ").insert( name ).insert(" is " ).insert(age); System.out.println(sb);
D. sb.append("My dog ").append( name ).append(" is " ).append(age);
System.out.println(sb);
Answer: AD
Q37. public class MyFor {
public static void main(String[] args) {
for (int ii = 0; ii < 4; ii++) {
System.out.println("ii = "+ ii);
ii = ii +1;
}
}
}
What is the result?
A. ii = 0
ii = 2
B. ii = 0
ii = 1
ii = 2
ii = 3
C. ii =
D. Compilation fails.
Answer: A
Q38. Which two are Java Exception classes?
A. SercurityException
B. DuplicatePathException
C. IllegalArgumentException
D. TooManyArgumentsException
Answer: AC
Q39. The protected modifier on a Field declaration within a public class means that the field
______________.
A. Cannot be modified
B. Can be read but not written from outside the class
C. Can be read and written from this class and its subclasses only within the same
package
D. Can be read and written from this class and its subclasses defined in any package
Answer: D
Q40. What is the result when this program is executed?
A. Bob's Name: Bob
B. Bob's Name: Jian
C. Nothing prints
D. Bob’s name
Answer: B