Oracle 1z0-803 Exam Practice Questions (P. 3)
- Full Access (216 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #11
Given:

Which two actions, used independently, will permit this class to compile?

Which two actions, used independently, will permit this class to compile?
- AAdding throws IOException to the main() method signature
- BAdding throws IOException to the doSoomething() method signature
- CAdding throws IOException to the main() method signature and to the dosomething() method
- DAdding throws IOException to the dosomething() method signature and changing the catch argument to IOException
- EAdding throws IOException to the main() method signature and changing the catch argument to IOException
Correct Answer:
CD
CD
send
light_mode
delete
Question #12
Given:

What is the result?

What is the result?
- AHello
- BDefault
- CCompilation fails
- DThe program prints nothing
- EAn exception is thrown at run time
Correct Answer:
A
The program compiles fine.
The program runs fine.
The output is: hello
A
The program compiles fine.
The program runs fine.
The output is: hello
send
light_mode
delete
Question #13
Given:

Which statement, when inserted into line 5, is valid change?

Which statement, when inserted into line 5, is valid change?
- Aasc = sc;
- Bsc = asc;
- Casc = (object) sc;
- Dasc = sc.clone ()
Correct Answer:
B
Works fine.
Incorrect answers:
asc = sc.clone();
Incompatible types.
asc =sc;
Incompatible types.
asc = (object) sc;
Syntax error
B
Works fine.
Incorrect answers:
asc = sc.clone();
Incompatible types.
asc =sc;
Incompatible types.
asc = (object) sc;
Syntax error
send
light_mode
delete
Question #14
Given the code fragment:
System.out.printIn("Result: " + 2 + 3 + 5);
System.out.printIn("Result: " + 2 + 3 * 5);
What is the result?
System.out.printIn("Result: " + 2 + 3 + 5);
System.out.printIn("Result: " + 2 + 3 * 5);
What is the result?
- AResult: 10 Result: 30
- BResult: 10 Result: 25
- CResult: 235 Result: 215
- DResult: 215 Result: 215
- ECompilation fails
Correct Answer:
C
First line:
System.out.println("Result: " + 2 + 3 + 5);
String concatenation is produced.
Second line:
System.out.println("Result: " + 2 + 3 * 5);
3*5 is calculated to 15 and is appended to string 2. Result 215.
The output is:
Result: 235 -
Result: 215 -
Note #1:
To produce an arithmetic result, the following code would have to be used:
System.out.println("Result: " + (2 + 3 + 5));
System.out.println("Result: " + (2 + 1 * 5));
run:
Result: 10 -
Result: 7 -
Note #2:
If the code was as follows:
System.out.println("Result: " + 2 + 3 + 5");
System.out.println("Result: " + 2 + 1 * 5");
The compilation would fail. There is an unclosed string literal, 5", on each line.
C
First line:
System.out.println("Result: " + 2 + 3 + 5);
String concatenation is produced.
Second line:
System.out.println("Result: " + 2 + 3 * 5);
3*5 is calculated to 15 and is appended to string 2. Result 215.
The output is:
Result: 235 -
Result: 215 -
Note #1:
To produce an arithmetic result, the following code would have to be used:
System.out.println("Result: " + (2 + 3 + 5));
System.out.println("Result: " + (2 + 1 * 5));
run:
Result: 10 -
Result: 7 -
Note #2:
If the code was as follows:
System.out.println("Result: " + 2 + 3 + 5");
System.out.println("Result: " + 2 + 1 * 5");
The compilation would fail. There is an unclosed string literal, 5", on each line.
send
light_mode
delete
Question #15
Which code fragment is illegal?


- AOption A
- BOption B
- COption C
- DOption D
Correct Answer:
D
The abstract keyword cannot be used to declare an int variable.
The abstract keyword is used to declare a class or method to be abstract[3]
. An abstract method has no implementation; all classes containing abstract methods must themselves be abstract, although not all abstract classes have abstract methods.
D
The abstract keyword cannot be used to declare an int variable.
The abstract keyword is used to declare a class or method to be abstract[3]
. An abstract method has no implementation; all classes containing abstract methods must themselves be abstract, although not all abstract classes have abstract methods.
send
light_mode
delete
All Pages