
Which statement is true?
Show answerHide answer
Correct answer: B
Only s is accessible by obj.
Java SE 8 Programmer I
Free 1z0-808 mock exam questions 41–50, each with the answer and an explanation.
20 questions · 33 minutes · free, no sign-up

Which statement is true?
Correct answer: B
Only s is accessible by obj.
Given the code fragment: 
What is the result?
Correct answer: B
Found Teal
Which statement is/are true?
I. Default constructor only contains "super();" call.
II. We can't use any access modifier with a constructor.
III. A constructor should not have a return type.
Correct answer: D
Only I and III.
Statement I is correct as the default constructor only contains super0 call
Statement II is incorrect as we can use any access modifier with a constructor.
Statement III is correct as constructor can't have return type, even void.
So option D is correct.
httpsy/docs.oracle.com/javase/tutorial/iava/javaOO/construaors.html
Given:
public class SampleClass {
public static void main(String[] args) {
AnotherSampleClass asc = new AnotherSampleClass(); SampleClass sc = new
SampleClass();
sc = asc;
System.out.println("sc: " + sc.getClass());
System.out.println("asc: " + asc.getClass());
}}
class AnotherSampleClass extends SampleClass {
}
What is the result?
Correct answer: D
sc: class AnotherSampleClass
asc: class AnotherSampleClass
Given:
Correct answer: B, C
Option B Option C
When an abstract class is subclassed, the subclass usually provides
implementations for all of the abstract methods in its parent class (C). However, if it does
not, then the subclass must also be declared abstract (B).
Note: An abstract class is a class that is declared abstract—it may or may not include
abstract methods. Abstract classes cannot be instantiated, but they can be subclassed
Given the code fragment
Which option represents the state of the num array after successful completion of the outer
loop?
Correct answer: A
Option A
Given:
What is the result?
Correct answer: E
Compilation fails
View the exhibit.
Which change enables the code to print the following?
James age: 20
Williams age: 32
Correct answer: C
Enclosing line 6 and line 7 within a try block and adding:
catch(Exception e1) { //code goes here}
catch (missingInfoException e2) { //code goes here}
catch (AgeOutofRangeException e3) {//code goes here}
Given the code fragment:
What is the result?
Correct answer: A
10 : 10
Given the code fragment:
Which modification enables the code to print 54321?
Correct answer: B
At line 7, insert x --;
Full-length mocks with the same number of questions and the same time limit as the real 1z0-808 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.
Get full 1z0-808 mock exam