Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-850
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-850.html
Java Standard Edition 5 and 6, Certified Associate Exam
Question No: 111 – (Topic 1)
Which two are true? (Choose two.)
-
A single import statement can be used to simplify access to several packages in the Java API.
-
A single import statement can be used to simplify access to several classes in the Java API.
-
An import statement is associated with only one class in a source file.
-
A source file can have from zero to many import statements.
-
If a source file has one import statement, it must be preceded by a package statement.
Answer: B,D
Question No: 112 – (Topic 1)
Which two are true about the java and javac commands? (Choose two.)
-
java -classpath lets you specify one or more directories to be used by the JVM to locate class files.
-
java -version will print the version of the JVM.
-
java -classpath will print the classpath used by the JVM.
-
javac -version will print the OS version for the machine on which the JDK is installed.
-
javac -D lets you specify the destination directory for the compiled class files.
Answer: A,B
Question No: 113 – (Topic 1)
Which option for javac sets the destination directory for class files?
-
-classes lt;directorygt;
-
-d lt;directorygt;
-
-dest lt;directorygt;
-
-classpath lt;directorygt;
-
-output lt;directorygt;
-
-directory lt;directorygt;
Answer: B
Question No: 114 – (Topic 1)
Given:
-
public class Foo {
-
int size;
-
public static void main(String[] args) {
-
Foo f = new Foo();
-
f.setSize(5);
-
Foo g = f.go(f);
-
System.out.print(f.size quot; : quot; g.size); 8. }
-
-
void setSize(int s) {
-
size = s;
11. }
-
public Foo go(Foo g) {
-
g.setSize(2);
-
return g;
15. }
16. }
What is the result?
A. Compilation fails.
B. 2 : 5
C. 5 : 5
D. 2 : 2
Answer: D
Question No: 115 – (Topic 1)
Given:
-
int time = 12;
-
if ( time lt; 12 ) {
-
System.out.println(quot;Good morningquot;); 9. }
-
// insert code here
-
System.out.println(quot;Good afternoonquot;);
12. }
-
else if ( time gt;= 18 ) {
-
System.out.println(quot;Good eveningquot;);
15. }
Which three, inserted independently at line 10, produce the output Good afternoon? (Choose three.)
-
else if ( time lt; 12 || time gt; 18) {
-
if ( time gt;= 12 amp;amp; time lt; 18 ) {
-
else if ( time gt; 12 amp;amp; time gt;= 18 ) {
-
else if ( time gt;= 12 || time lt; 18 ) {
-
else if ( time gt; 12 || time lt;= 18 ) {
Answer: B,D,E
Question No: 116 – (Topic 1)
You need an algorithm that must:
Print the characters of a String, in index order
Skip all instances of the character #39;a#39; that appear in the String Given:
-
public void foo (String s) {
-
// insert code here 4. }
Which two, inserted independently at line 3, correctly implement the algorithm? (Choose two.)
-
int i = 0;
while (i lt; s.length()) { if (s.charAt(i) != #39;a#39;) { System.out.print(i);
} i ;
}
-
for(char c:s) {
if (c != #39;a#39;) System.out.print(c);
}
-
for(int i = 0; i lt; s.length(); i ) { char c = s.charAt(i);
if (c != #39;a#39;) System.out.print(c);
}
-
for (int i = 0; i lt; s.length(); i ) {
if (s.charAt(i) != #39;a#39;) System.out.print(i);
}
-
int i = 0;
while (i lt; s.length()) { if (s.charAt(i) != #39;a#39;) {
System.out.print(s.charAt(i));
} i ;
}
Answer: C,E
Question No: 117 – (Topic 1)
Which J2EE technology is used to generate dynamic content for web-based applications?
-
JAX-RPC
-
JNDI
-
JMS
-
SOAP
-
JSP
Answer: E
Question No: 118 – (Topic 1)
How can the two class paths be set for the javac compiler? (Choose two.)
-
using the PATH environment variable
-
using the -classpath option to java
-
using the CLASSPATH environment variable
-
using the -sourcepath option to javac
-
using the -classpath option to javac
-
using the BIN environment variable
-
using the -classes option to javac
Answer: C,E
Question No: 119 – (Topic 1)
Given:
-
-
-
class Example {
-
int x = 50; 6. int y = 100;
7. public static void main(String args[]) { 8. int x = 0, y = 10;
-
Example ex = new Example();
-
while (x lt; 3) { 11. x ; y-;
12. }
13. System.out.println(quot;x = quot; x quot; , y = quot; y);
14. }
15. }
What is the result?
-
Compilation fails because of an error at line 10.
-
Compilation fails because of an error at line 8.
C. x = 53 , y = 97
-
Compilation fails because of an error at line 9.
-
Compilation fails because of an error at line 11.
F. x = 3 , y = 7
Answer: F
Question No: 120 – (Topic 1)
Given:
-
class TestVars {
-
int x, y;
-
char c;
-
// insert code here 7. }
Which three, inserted independently at line 6, allow the code to compile? (Choose three.)
-
int z = x/y;
-
boolean t = y;
-
char d = (char) y;
-
boolean bool = quot;falsequot;;
-
int x = y ;
-
int g = c;
-
Answer: A,C,F
100% Ensurepass Free Download!
–Download Free Demo:1z0-850 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-850 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