The Leading Company Provides Valid Exam Cram PDF & Dumps PDF Materials
The Leading Company Provides Valid Exam Cram PDF & Dumps PDF Materials
The Leading Company Provides Valid Exam Cram PDF & Dumps PDF Materials
http://www.crampdf.com
The leading company provides valid exam cram PDF & dumps PDF materials
IT Certification Guaranteed, The Easy Way!
Exam : 1z0-803
Vendor : Oracle
Version : DEMO
1
IT Certification Guaranteed, The Easy Way!
A. Found Red
B. Found Red Found Blue
C. Found Red Found Blue Found White
D. Found Red Found Blue Found White Found Default
Answer: B
Explanation:
As there is no break statement after the case "Red" statement the case Blue statement will run as
well.
Note: The body of a switch statement is known as a switch block. A statement in the switch block can
be labeled with one or more case or default labels. The switch statement evaluates its expression,
then executes all statements that follow the matching case label.
Each break statement terminates the enclosing switch statement. Control flow continues with the
first statement following the switch block. The break statements are necessary because without
them, statements in switch blocks fall through: All statements after the matching case label are
executed in sequence, regardless of the expression of subsequent case labels, until a break statement
is encountered.
2
IT Certification Guaranteed, The Easy Way!
NO.3 Given:
public class X {
static int i;
int j;
public static void main(String[] args) {
X x1 = new X();
X x2 = new X();
x1.i = 3;
x1.j = 4;
x2.i = 5;
x2.j = 6;
System.out.println(
x1.i + " "+
x1.j + " "+
x2.i + " "+
x2.j);
} } What is the result?
A. 3 4 5 6
B. 3 4 3 6
C. 5 4 5 6
D. 3 6 4 6
Answer: C
NO.4 Given:
3
IT Certification Guaranteed, The Easy Way!
Answer: E
Explanation:
The line while (--ii); will cause the compilation to fail. ii is not a boolean value.
A correct line would be while (--ii>0);
NO.6 Given:
4
IT Certification Guaranteed, The Easy Way!
A. 0 Done
B. First Exception Done
C. Second Exception
D. Done Third Exception
E. Third Exception
Answer: E
NO.8 Given:
5
IT Certification Guaranteed, The Easy Way!
A. Option A
B. Option B
C. Option C
D. Option D
Answer: A,D
Explanation:
The first println statement, System.out.println("Before if clause");, will always run.
If Math.Random() > 0.5 then there is an exception. The exception message is displayed and the
program terminates.
If Math.Random() > 0.5 is false, then the second println statement runs as well.
6
IT Certification Guaranteed, The Easy Way!
NO.11 Given:
class Cake { int model; String flavor; Cake() { model = 0; flavor = "Unknown"; }
} public class Test {
public static void main(String[] args) {
Cake c = new Cake();
bake1(c);
System.out.println(c.model + " " + c.flavor);
bake2(c);
System.out.println(c.model + " " + c.flavor);
}
public static Cake bake1(Cake c) {
c.flavor = "Strawberry";
c.model = 1200;
return c;
}
public static void bake2(Cake c) {
c.flavor = "Chocolate";
c.model = 1230;
return;
}}
What is the result?
A. 0 unknown 0 unknown
B. 1200 Strawberry 1200 Strawberry
C. 1200 Strawberry 1230 Chocolate
D. Compilation fails
Answer: C
7
IT Certification Guaranteed, The Easy Way!
Explanation:
1200 Strawberry
1230 Chocolate
NO.12 Given:
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
8
IT Certification Guaranteed, The Easy Way!
A. true true
B. true false
C. false true
9
IT Certification Guaranteed, The Easy Way!
D. false false
E. Compilation fails
Answer: E
NO.16 Given:
public class MyClass { public static void main(String[] args) { while (int ii = 0; ii < 2) { ii++;
System.out.println("ii = " + ii); } }
}
What is the result?
A. ii = 1 ii = 2
B. Compilation fails
C. The program prints nothing
D. The program goes into an infinite loop with no output
E. The program goes to an infinite loop outputting: ii = 1 ii = 1
10
IT Certification Guaranteed, The Easy Way!
Answer: B
Explanation:
The while statement is incorrect. It has the syntax of a for statement.
The while statement continually executes a block of statements while a particular condition is true.
Its syntax can be expressed as:
while (expression) {
statement(s)
}
The while statement evaluates expression, which must return a boolean value. If the expression
evaluates to true, the while statement executes the statement(s) in the while block. The while
statement continues testing the expression and executing its block until the expression evaluates
to false.
Reference: The while and do-while Statements
11