#Exercicios Java
#Exercicios Java
Oracle
Exam 1z0-808
Java SE 8 Programmer I
Version: 10.0
A. Invalid Name
B. Invalid Nameomas
C. Invalid Nameomasnullnull
D. omasterseph
Answer: C
Question No : 2
2
Oracle 1z0-808 : Practice Test
Which two modifications should you make so that the code compiles successfully?
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: E
Question No : 3
3
Oracle 1z0-808 : Practice Test
Given the code fragment:
Answer: D
Question No : 4
4
Oracle 1z0-808 : Practice Test
A. 5 : 5
B. 10 : 10
C. 5 : 10
D. Compilation fails.
Answer: B
Explanation: References:
Question No : 5
5
Oracle 1z0-808 : Practice Test
A. 2012-02-10
B. 2012-02-11
C. Compilation fails
D. A DateTimeException is thrown at runtime.
Answer: C
Question No : 6
Which code fragment, when inserted at line n1, enables the App class to print Equal?
6
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Question No : 7
Which three statements are true about the structure of a Java class?
Answer: A,C,E
Question No : 8
7
Oracle 1z0-808 : Practice Test
Answer: C
Question No : 9
Given:
8
Oracle 1z0-808 : Practice Test
A. AB
B. AC
C. CC
D. A ClassCastException is thrown only at line n1.
E. A ClassCastException is thrown only at line n2.
Answer: B
Question No : 10
9
Oracle 1z0-808 : Practice Test
Which code fragment causes a compilation error?
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: D
Question No : 11
10
Oracle 1z0-808 : Practice Test
A. Answer = 0
B. Invalid calculation
C. Compilation fails only atline n1.
D. Compilation fails only atline n2.
E. Compilation fails only atline n1andline2.
Answer: E
Question No : 12
Which two changes would encapsulate this class and ensure that the area field is always
equal to length * height whenever the Rectangle class is used?
11
Oracle 1z0-808 : Practice Test
A. Call the setArea method at the end of the setHeight method.
B. Call the setArea method at the beginning of the setHeight method.
C. Call the setArea method at the end of the setLength method.
D. Call the setArea method at the beginning of the setLength method.
E. Change the setArea method to private.
F. Change the area field to public.
Answer: A,E
Question No : 13
A. 1324
B. 2413
C. 3142
D. 4231
Answer: C
Question No : 14
12
Oracle 1z0-808 : Practice Test
C. Its case label literals can be changed at runtime.
D. Its expression must evaluate to a single value.
Answer: D
Explanation: References:
Question No : 15
A. Jesse 25Walter 52
B. Compilation fails only at line n1
C. Compilation fails only at line n2
D. Compilation fails at both line n1 and line n2
Answer: B
13
Oracle 1z0-808 : Practice Test
Question No : 16
Given:
A. 300:300200:300
B. 300:100200:300
C. 300:00:300
D. 200:300200:300
Answer: D
Question No : 17
14
Oracle 1z0-808 : Practice Test
Given the definitions of the MyString class and the Test class:
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Question No : 18
You are asked to develop a program for a shopping application, and you are given the
15
Oracle 1z0-808 : Practice Test
following information:
Which definition of the Toy class adds a valid layer of abstraction to the class hierarchy?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Question No : 19
16
Oracle 1z0-808 : Practice Test
Answer: A
Question No : 20
Given the following code for the classes MyException and Test:
17
Oracle 1z0-808 : Practice Test
A. A
B. B
C. Either A or B
D. A B
E. A compile time error occurs at line n1
Answer: B
Question No : 21
Given:
18
Oracle 1z0-808 : Practice Test
A. 10:20
B. 0:20
C. Compilation fails at line n1
D. Compilation fails at line n2
Answer: D
19
Oracle 1z0-808 : Practice Test
Question No : 22
Which command-line arguments should you pass to the program to obtain the following
output?
Arg is 2
A. java MyFile 1 3 2 2
B. java MyFile 2 2 2
C. java MyFile 1 2 2 3 4
D. java MyFile 0 1 2 3
Answer: A
Question No : 23
20
Oracle 1z0-808 : Practice Test
Which three pieces of code, when inserted independently, set the value of amount to 100?
21
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
F. Option F
Answer: B,C,E
Question No : 24
A. 44
B. 35
C. 47
D. 54
E. 45
F. 421
Answer: E
Question No : 25
22
Oracle 1z0-808 : Practice Test
A. 2 4
B. 0 2 4 6
C. 0 2 4
D. Compilation fails
Answer: C
Question No : 26
A. Match 1
B. Match 2
C. No Match
23
Oracle 1z0-808 : Practice Test
D. A NullPointerException is thrown at runtime.
Answer: B
Question No : 27
Given:
Answer: D
Question No : 28
24
Oracle 1z0-808 : Practice Test
Given:
A. Compilation fails.
B. 11
C. 8
D. 9
E. 10
Answer: D
Question No : 29
Which three statements describe the object-oriented features of the Java language?
Answer: B,C,F
Explanation: References:
Question No : 30
25
Oracle 1z0-808 : Practice Test
Given:
A. false, false
B. false, true
C. true, false
D. true, true
Answer: B
Question No : 31
26
Oracle 1z0-808 : Practice Test
Answer: C
Question No : 32
A. 10 Hello World!
B. Hello Universe!
C. Hello World!
D. Compilation fails.
Answer: A
27
Oracle 1z0-808 : Practice Test
Question No : 33
A. Compilation fails.
B. Hi removed
C. An UnsupportedOperationException is thrown at runtime.
D. The program compiles, but it prints nothing.
Answer: A
Question No : 34
28
Oracle 1z0-808 : Practice Test
A. A B C
B. A B C D E
C. A B D E
D. Compilation fails.
Answer: C
Question No : 35
Given:
A. Option A
B. Option B
C. Option C
29
Oracle 1z0-808 : Practice Test
D. Option D
Answer: D
Question No : 36
What is the name of the Java concept that uses access modifiers to protect variables and
hide them within a class?
A. Encapsulation
B. Inheritance
C. Abstraction
D. Instantiation
E. Polymorphism
Answer: A
Explanation:
Using the private modifier is the main way that an object encapsulates itself and hide data
from the outside world.
References:
Question No : 37
30
Oracle 1z0-808 : Practice Test
A. 3
B. 4
C. -1
D. Compilation fails.
Answer: B
Question No : 38
Given:
31
Oracle 1z0-808 : Practice Test
javac Test.Java
A. Success
B. Failure
C. Compilation fails.
D. An exception is thrown at runtime
Answer: B
Question No : 39
Given:
32
Oracle 1z0-808 : Practice Test
And given the commands:
javac Test.java
java Test
A. Java SE
B. Java EE
C. Compilation fails at line n1.
D. A NullPointerException is thrown at runtime.
Answer: A
Question No : 40
33
Oracle 1z0-808 : Practice Test
Answer: A
Question No : 41
Test.java
34
Oracle 1z0-808 : Practice Test
Which is the result?
Answer: E
Question No : 42
Given:
Acc.java:
35
Oracle 1z0-808 : Practice Test
Answer: B
Question No : 43
Which code fragment, when inserted at line 2, enables the code to compile?
36
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: E
Question No : 44
37
Oracle 1z0-808 : Practice Test
Answer: C
Question No : 45
Given:
A. Area is 6.0
B. Area is 3.0
C. Compilation fails at line n1
D. Compilation fails at line n2.
38
Oracle 1z0-808 : Practice Test
Answer: D
Question No : 46
Given:
A. 200.0 : 100.0
B. 400.0 : 200.0
C. 400.0 : 100.0
D. Compilation fails.
Answer: C
Question No : 47
39
Oracle 1z0-808 : Practice Test
Which two code fragments, independently, print each element in this array?
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
F. Option F
Answer: B,E
Question No : 48
40
Oracle 1z0-808 : Practice Test
Given the code fragment:
Answer: D
Question No : 49
Given:
41
Oracle 1z0-808 : Practice Test
A. Compilation fails.
B. 3 5
C. 0 0
D. 9 25
Answer: B
Question No : 50
Given:
42
Oracle 1z0-808 : Practice Test
A. C B A
B. C
C. A B C
D. Compilation fails at line n1 and line n2
Answer: C
Question No : 51
43
Oracle 1z0-808 : Practice Test
A. 100
B. 101
C. 102
D. 103
E. Compilation fails
Answer: E
Question No : 52
2. Process all the elements of the array in the reverse order of entry.
Answer: D,E
Question No : 53
44
Oracle 1z0-808 : Practice Test
Given the code fragment:
A. A B C Work done
B. A B C D Work done
C. A Work done
D. Compilation fails
Answer: C
Question No : 54
45
Oracle 1z0-808 : Practice Test
A. An exception is thrown at runtime.
B. -1
C. 5
D. 0
Answer: A
Question No : 55
A. true true
B. true false
C. false false
D. false true
Answer: C
Question No : 56
46
Oracle 1z0-808 : Practice Test
A. An exception is thrown at runtime.
B. Compilation fails.
C. 13480.0
D. 13480.02
Answer: C
Question No : 57
Given:
Which code fragment should you use at line n1 to instantiate the dvd object successfully?
47
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Question No : 58
Which code fragment, inserted at line n1, pints The Top element: 30?
48
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: A
Question No : 59
fragment:
49
Oracle 1z0-808 : Practice Test
Which two modifications should you make so that the code compiles successfully?
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: A,C
Question No : 60
50
Oracle 1z0-808 : Practice Test
Which code fragment, when inserted at line n1, enables the code to print Hank?
Answer: C
Question No : 61
51
Oracle 1z0-808 : Practice Test
Answer: B,C
Question No : 62
Which three code fragments can be independently inserted at line n1 to enable the code to
print one?
A. Byte x = 1;
B. short x = 1;
C. String x = "1";
D. Long x = 1;
E. Double x = 1;
F. Integer x = new Integer ("1");
Answer: A,B,F
Question No : 63
52
Oracle 1z0-808 : Practice Test
B. More efficient code at runtime
C. More dynamic code at runtime
D. More flexible and reusable code
E. Code that is protected from extension by other classes
Answer: B,D
Explanation: References:
Question No : 64
53
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Question No : 65
Given:
54
Oracle 1z0-808 : Practice Test
Answer: A
Given:
55
Oracle 1z0-808 : Practice Test
A) stuff.equals (“TV”) ? res= “Walter” : stuff.equals (“Movie”) ? res = “White” : res = “No
Result”;
B) res = stuff.equals (“TV”) ? “Walter” else stuff.equals (“Movie”)? “White” : “No Result”;
Question No : 67
Given:
56
Oracle 1z0-808 : Practice Test
Which two sets of actions, independently, enable the code fragment to print Fit?
Answer: A
Question No : 68
57
Oracle 1z0-808 : Practice Test
A. 1:2:3:4:5:
B. 1:2:3:
C. Compilation fails.
D. An ArrayoutofBoundsException is thrown at runtime.
Answer: A
Question No : 69
58
Oracle 1z0-808 : Practice Test
Answer: E
Question No : 70
Given:
59
Oracle 1z0-808 : Practice Test
A. int main 1
B. Object main 1
C. String main 1
D. Compilation fails
E. An exception is thrown at runtime
Answer: C
Question No : 71
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
created
60
Oracle 1z0-808 : Practice Test
Answer: A,C,D
Explanation: References:
Question No : 72
Given:
Answer: D
Question No : 73
61
Oracle 1z0-808 : Practice Test
Which statement is true about Java byte code?
Answer: D
Explanation: References:
Question No : 74
Given:
A. 10 20 30 40
B. 0 0 30 40
62
Oracle 1z0-808 : Practice Test
C. Compilation fails.
D. An exception is thrown at runtime.
Answer: C
Question No : 75
Given:
Answer: C
Question No : 76
63
Oracle 1z0-808 : Practice Test
Given the code fragment:
A. Compilation fails.
B. 10 Hello Universe!
C. 10 Hello World!
D. 9 Hello World!
Answer: C
Question No : 77
Given:
64
Oracle 1z0-808 : Practice Test
A. C2C2
B. C1C2
C. C1C1
D. Compilation fails
Answer: A
Question No : 78
65
Oracle 1z0-808 : Practice Test
What is the result?
A. Compilation fails.
B. 0 Found
C. 1 Found
D. 3 Found
Answer: D
Question No : 79
A. Line 7
B. Line 8
C. Line 9
D. Line 10
E. Line 11
F. Line 12
Answer: A,D,F
Question No : 80
66
Oracle 1z0-808 : Practice Test
Given the code fragment:
Which two code fragments can be independently inserted at line n1 to enable the code to
print the elements of the array in reverse order?
Answer: B,E
Question No : 81
Assume that the system date is June 20, 2014. What is the result?
67
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Question No : 82
You are asked to create a method that accepts an array of integers and returns the highest
value from that array.
68
Oracle 1z0-808 : Practice Test
Which method signature do you use at line n1?
Answer: A
Question No : 83
A. Sum is 600
B. Compilation fails at line n1.
C. Compilation fails at line n2.
D. A ClassCastException is thrown at line n1.
E. A ClassCastException is thrown at line n2.
Answer: C
Question No : 84
69
Oracle 1z0-808 : Practice Test
Answer: C,D
Question No : 85
Given:
70
Oracle 1z0-808 : Practice Test
A. 10 : 30 : 6
B. 10 : 22 : 22
C. 10 : 22 : 20
D. 10 : 22 : 6
Answer: B
Explanation:
Explanation
Question No : 86
71
Oracle 1z0-808 : Practice Test
Which two modifications, when made independently, enable the code to print joe:true:
100.0?
72
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: A,C
Question No : 87
Given:
73
Oracle 1z0-808 : Practice Test
A. BaseDerivedA
B. BaseDerivedB
C. DerivedBDerivedB
D. DerivedBDerivedA
E. A classcast Exception is thrown at runtime.
Answer: C
74
Oracle 1z0-808 : Practice Test
Question No : 88
Given:
A. 3 4 5 6
B. 3 4 3 6
C. 5 4 5 6
D. 3 6 4 6
Answer: C
Question No : 89
75
Oracle 1z0-808 : Practice Test
A. Only unchecked exceptions can be rethrown.
B. All subclasses of the RuntimeException class are recoverable.
C. The parameter in a catch block is of Throwable type.
D. All subclasses of the RuntimeException class must be caught or declared to be thrown.
E. All subclasses of the Exception class except the RuntimeException class are checked
exceptions.
F. All subclasses of the Error class are checked exceptions and are recoverable.
Answer: C,E,F
Question No : 90
Which two code fragments can be independently placed at line n1 to meet the
requirements?
76
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: A,C
Question No : 91
77
Oracle 1z0-808 : Practice Test
A. 10 : 10
B. 5 : 5
C. 5 : 10
D. Compilation fails
Answer: A
Question No : 92
Given:
78
Oracle 1z0-808 : Practice Test
A. Compilation fails.
B. false true
C. true false
D. true true
E. false false
Answer: B
Question No : 93
Given:
79
Oracle 1z0-808 : Practice Test
A. nullRichardDonald
B. RichardDonald
C. Compilation fails.
D. AnArrayIndexOutOfBoundsExceptionis thrown at runtime.
E. ANullPointerExceptionis thrown at runtime.
Answer: A
Question No : 94
Which one of the following code examples uses valid Java syntax?
80
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Explanation: References:
Question No : 95
Given:
81
Oracle 1z0-808 : Practice Test
Answer: C
Question No : 96
82
Oracle 1z0-808 : Practice Test
Given the code fragment:
A. Replace line 5 With String opt= "true";Replace line 7 with case "true":
B. Replace line 5 with boolean opt = l;Replace line 7 with case 1=
C. At line 9, remove the break statement.
D. Remove the default section.
Answer: A
Question No : 97
Which option represents the state of the num array after successful completion of the outer
loop?
83
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Question No : 98
Given:
84
Oracle 1z0-808 : Practice Test
Answer: B
Question No : 99
85
Oracle 1z0-808 : Practice Test
Which line of code, when inserted in place of //line n1, adds an X into the grid so that the
grid contains three consecutive X’s?
A. grid[1][3] = ‘X’;
B. grid[3][1] = ‘X’;
C. grid[0][2] = ‘X’;
D. grid[2][0] = ‘X’;
E. grid[1][2] = ‘X’;
Answer: C
Question No : 100
Given:
86
Oracle 1z0-808 : Practice Test
Answer: C
Question No : 101
87
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Question No : 102
Given:
88
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
89
Oracle 1z0-808 : Practice Test
Answer: B
Question No : 103
Given:
class Test
int a1;
a = a * a;
s.append(“ “ + s);
item.a1 = 11;
Integer i = 10;
doProduct(i);
doString(sb);
doProduct(item.a1);
System.out.println(i + “ “ + sb + “ “ + item.a1);
90
Oracle 1z0-808 : Practice Test
What is the result?
A. 10 Hello Hello 11
B. 10 Hello Hello 121
C. 100 Hello 121
D. 100 Hello Hello 121
E. 10 Hello 11
Answer: B
Question No : 104
Given:
Book1.readBook();
91
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A
Question No : 105
Given:
92
Oracle 1z0-808 : Practice Test
Answer: B
Question No : 106
93
Oracle 1z0-808 : Practice Test
Answer: A
Question No : 107
Given:
94
Oracle 1z0-808 : Practice Test
How many MarkList instances are created in memory at runtime?
A. 1
B. 2
C. 3
D. 4
Answer: A
Question No : 108
95
Oracle 1z0-808 : Practice Test
Answer: D
Question No : 109
Given:
96
Oracle 1z0-808 : Practice Test
Which code fragment, when inserted at line 14, enables the code to print Mike Found?
Answer: A
Question No : 110
97
Oracle 1z0-808 : Practice Test
Answer: D
Question No : 111
Given:
98
Oracle 1z0-808 : Practice Test
javac Test.java
A. TRUE null
B. true false
C. false false
D. true true
E. AClassCastExceptionis thrown at runtime.
Answer: D
Question No : 112
99
Oracle 1z0-808 : Practice Test
100
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: C
Question No : 113
101
Oracle 1z0-808 : Practice Test
A. 5 4 3 2 1 0
B. 5 4 3 2 1
C. 4 2 1
D. 5
E. Nothing is printed
Answer: D
Question No : 114
Given:
102
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Question No : 115
Given:
103
Oracle 1z0-808 : Practice Test
C. Welcome Visit Count:1Welcome Visit Count: 2
D. Welcome Visit Count:1Welcome Visit Count: 2
Answer: B
Question No : 116
Given:
A. True false
B. True null
C. Compilation fails
D. A NullPointerException is thrown at runtime
Answer: A
Question No : 117
Given:
104
Oracle 1z0-808 : Practice Test
A. true:true
B. true:false
C. false:true
D. false:false
Answer: C
Question No : 118
Given:
105
Oracle 1z0-808 : Practice Test
A. A B C D
B. A C D
C. A B C C
D. A B D
E. A B D C
Answer: E
Question No : 119
And,
106
Oracle 1z0-808 : Practice Test
A. After line 11, three objects are eligible for garbage collection.
B. After line 11, two objects are eligible for garbage collection.
C. After line 11, one object is eligible for garbage collection.
D. After line 11, none of the objects are eligible for garbage collection.
Answer: C
Question No : 120
107
Oracle 1z0-808 : Practice Test
How should you write methods in the ElectricAccount class at line n1 so that the member
variable bill is always equal to the value of the member variable kwh multiplied by the
member variable rate?
A. Option A
B. Option B
108
Oracle 1z0-808 : Practice Test
C. Option C
D. Option D
Answer: A,C
Question No : 121
Which code fragment, when inserted at line 3, enables the code to print 10:20?
Answer: B
Question No : 122
Given:
109
Oracle 1z0-808 : Practice Test
Answer: C
Question No : 123
110
Oracle 1z0-808 : Practice Test
A. 1 2 3 4followed by an ArrayIndexOutOfBoundsException
B. 1 2 3
C. 1 2 3 4
D. Compilation fails.
Answer: A
Question No : 124
111
Oracle 1z0-808 : Practice Test
Answer: C
Question No : 125
Which statement will empty the contents of a StringBuilder variable named sb?
Answer: C
Question No : 126
Given:
112
Oracle 1z0-808 : Practice Test
Which two modifications enable the code to print the following output?
113
Oracle 1z0-808 : Practice Test
Canine 60 Long
Feline 80 Short
Answer: A
Question No : 127
Given:
A. 400 200
B. 200 200
C. 400 400
D. Compilation fails.
Answer: A
Question No : 128
114
Oracle 1z0-808 : Practice Test
Given the following class:
Which three lines, when inserted independently at line n1, cause the program to print a 0
balance?
A. this.amount = 0;
B. amount = 0;
C. acct (0) ;
D. acct.amount = 0;
E. acct. getAmount () = 0;
F. acct.changeAmount(0);
G. acct.changeAmount(-acct.amount);
H. acct.changeAmount(-acct.getAmount());
Answer: A,C,D
Question No : 129
115
Oracle 1z0-808 : Practice Test
Given the code fragment:
A. Element 0Element 1
B. Null element 0Null element 1
C. NullNull
D. A NullPointerException is thrown at runtime.
Answer: D
Question No : 130
A. Encapsulation ensures that classes can be designed so that only certain fields and
methods of an object are accessible from other objects.
B. Encapsulation ensures that classes can be designed so that their methods are
inheritable.
C. Encapsulation ensures that classes can be designed with some fields and methods
declared as abstract.
D. Encapsulation ensures that classes can be designed so that if a method has an
argument MyType x, any subclass of MyType can be passed to that method.
Answer: A
Question No : 131
116
Oracle 1z0-808 : Practice Test
Given the following class declarations:
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: E
Question No : 132
Which code fragment, when inserted at line 9, enables the code to print true?
117
Oracle 1z0-808 : Practice Test
A. String str2 = str1;
B. String str2 = new String (str1);
C. String str2 = sb1. toString ();
D. String str2 = "Duke";
Answer: B
Question No : 133
A. Option A
B. Option B
C. Option C
D. Option D
118
Oracle 1z0-808 : Practice Test
Answer: C
Question No : 134
Given:
A. e, ei, o
B. a, ei, o
C. a,eo, o
D. e, eo, o
Answer: A
Question No : 135
Given:
119
Oracle 1z0-808 : Practice Test
120
Oracle 1z0-808 : Practice Test
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B
Question No : 136
Which option can replace xxx to enable the code to print 135?
Answer: B
Question No : 137
You are developing a banking module. You have developed a class named ccMask that
has a maskcc method.
121
Oracle 1z0-808 : Practice Test
You must ensure that the maskcc method returns a string that hides all digits of the credit
card number except the four last digits (and the hyphens that separate each group of four
digits).
Which two code fragments should you use at line n1, independently, to achieve this
requirement?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: B,C
Question No : 138
122
Oracle 1z0-808 : Practice Test
Answer: F
Question No : 139
123
Oracle 1z0-808 : Practice Test
Which two options fail to compile when placed at line n1 of the main method?
A. employee.salary = 50_000;
B. director.salary = 80_000;
C. employee.budget = 200_000;
D. manager.budget = 1_000_000;
E. manager.stockOption = 500;
F. director.stockOptions = 1_000;
Answer: C,E
Question No : 140
124
Oracle 1z0-808 : Practice Test
A. abstract class A3 {private static int i;public void doStuff(){}public A3(){}}
B. final class A1 {public A1(){}}
C. public class A2 {private static int i;private A2(){}}
D. class A4 {protected static final int i;private void doStuff(){}}
E. final abstract class A5 {protected static int i;void doStuff(){}abstract void doIt();}
Answer: C,E
Question No : 141
What are the values of each element in intArr after this code has executed?
Answer: C
Question No : 142
125
Oracle 1z0-808 : Practice Test
Which three code fragments are valid at line n1?
Answer: C,D,E
126