Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-803
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-803.html
Java SE 7 Programmer I
Question No: 131
public class StringReplace {
public static void main(String[] args) { String message = quot;Hi everyone!quot;;
System.out.println(quot;message = quot; message.replace(quot;equot;, quot;Xquot;)); }
}
What is the result?
-
message = Hi everyone!
-
message = Hi XvXryonX!
-
A compile time error is produced.
-
A runtime error is produced.
-
message =
-
message = Hi Xveryone!
Answer: B
Question No: 132
Given:
class X {}
class Y { Y ( ) { } }
class Z { Z (int i ) { } }
Which class has a default constructor?
-
X only
-
Y only
-
Z only
-
X and Y
-
Y and Z
-
X and Z
-
X, Y and Z
Answer: A
Question No: 133
Given:
What is the result?
-
Initialized Started
-
Initialized Started Initialized
-
Compilation fails
-
An exception is thrown at runtime
Answer: B
Question No: 134
Give:
Public Class Test {
}
Which two packages are automatically imported into the java source file by the java compiler?
-
Java.lang
-
Java.awt
-
Java.util
-
Javax.net
-
Java.*
-
The package with no name
Answer: A,F Explanation:
For convenience, the Java compiler automatically imports three entire packages for each source file: (1) the package with no name, (2) the java.lang package, and (3) the current package (the package for the current file).
Note:Packages in the Java language itself begin withjava.orjavax.
Question No: 135
Given the code fragment:
System.out.printIn (quot;Result: quot; 3 5); System.out.printIn (quot;Result: quot; (3 5));
What is the result?
-
Result: 8 Result: 8
-
Result: 35 Result: 8
-
Result: 8 Result: 35
-
Result: 35 Result: 35
Answer: B Explanation:
In the first statement 3 and 5 are treated as strings andare simply concatenated. In the first statement 3 and 5 are treated as integers and their sum is calculated.
Question No: 136
Given the fragments:
Which line causes a compilation error?
-
Line n1
-
Line n2
-
Line n3
-
Line n4
Answer: A
Question No: 137
Given:
Class A { } Class B { }
Interface X { }
Interface Y { }
Which two definitions of class C are valid?
-
Class C extends A implements X { }
-
Class C implements Y extends B { }
-
Class C extends A, B { }
-
Class C implements X, Y extends B { }
-
Class C extends B implements X, Y { }
Answer: A,E
Explanation: extends is for extending a class.
implements is for implementing an interface.
Java allows for a class to implement many interfaces.
Question No: 138
Given:
What is the result?
A. 2 4 6 8
B. 2 4 6 8 9
C. 1 3 5 7
D. 1 3 5 7 9
Answer: A
Question No: 139
Given:
public class Test {
public static void main(String[] args) { int ax = 10, az = 30;
int aw = 1, ay = 1; try {
aw = ax % 2; ay = az / aw;
} catch (ArithmeticException e1) { System.out.println(quot;Invalid Divisorquot;);
} catch (Exception e2) { aw = 1;
System.out.println(quot;Divisor Changedquot;);
}
ay = az /aw; // Line 14 System.out.println(quot;Succesful Division quot; ay);
}
}
What is the result?
-
Invalid Divisor
Divisor Changed Successful Division 30
-
Invalid Divisor Successful Division 30
-
Invalid Divisor
Exception in thread quot;mainquot; java.lang.ArithmeticException: / by zero at test.Teagle.main(Teagle.java:14)
-
Invalid Divisor
Exception in thread quot;mainquot; java.lang.ArithmeticException: / by zero at test.Teagle.main(Teagle.java:14)
Successful Division 1
Answer: C
Question No: 140
Which statement will empty the contents of aStringBuilder variable named sb?
-
sb.deleteAll();
-
sb.delete(0, sb.size());
-
sb.delete(0, sb.length());
-
sb.removeAll();
Answer: C
100% Ensurepass Free Download!
–Download Free Demo:1z0-803 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-803 Dumps
EnsurePass | ExamCollection | Testking | |
---|---|---|---|
Lowest Price Guarantee | Yes | No | No |
Up-to-Dated | Yes | No | No |
Real Questions | Yes | No | No |
Explanation | Yes | No | No |
PDF VCE | Yes | No | No |
Free VCE Simulator | Yes | No | No |
Instant Download | Yes | No | No |
100-105 Dumps VCE PDF
200-105 Dumps VCE PDF
300-101 Dumps VCE PDF
300-115 Dumps VCE PDF
300-135 Dumps VCE PDF
300-320 Dumps VCE PDF
400-101 Dumps VCE PDF
640-911 Dumps VCE PDF
640-916 Dumps VCE PDF
70-410 Dumps VCE PDF
70-411 Dumps VCE PDF
70-412 Dumps VCE PDF
70-413 Dumps VCE PDF
70-414 Dumps VCE PDF
70-417 Dumps VCE PDF
70-461 Dumps VCE PDF
70-462 Dumps VCE PDF
70-463 Dumps VCE PDF
70-464 Dumps VCE PDF
70-465 Dumps VCE PDF
70-480 Dumps VCE PDF
70-483 Dumps VCE PDF
70-486 Dumps VCE PDF
70-487 Dumps VCE PDF
220-901 Dumps VCE PDF
220-902 Dumps VCE PDF
N10-006 Dumps VCE PDF
SY0-401 Dumps VCE PDF