[Free] 2018(Jan) EnsurePass Examcollection Oracle 1z0-803 Dumps with VCE and PDF 131-140

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?

  1. message = Hi everyone!

  2. message = Hi XvXryonX!

  3. A compile time error is produced.

  4. A runtime error is produced.

  5. message =

  6. 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?

  1. X only

  2. Y only

  3. Z only

  4. X and Y

  5. Y and Z

  6. X and Z

  7. X, Y and Z

Answer: A

Question No: 133

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. Initialized Started

  2. Initialized Started Initialized

  3. Compilation fails

  4. 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?

  1. Java.lang

  2. Java.awt

  3. Java.util

  4. Javax.net

  5. Java.*

  6. 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?

  1. Result: 8 Result: 8

  2. Result: 35 Result: 8

  3. Result: 8 Result: 35

  4. 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:

Ensurepass 2018 PDF and VCE

Which line causes a compilation error?

  1. Line n1

  2. Line n2

  3. Line n3

  4. Line n4

Answer: A

Question No: 137

Given:

Class A { } Class B { }

Interface X { }

Interface Y { }

Which two definitions of class C are valid?

  1. Class C extends A implements X { }

  2. Class C implements Y extends B { }

  3. Class C extends A, B { }

  4. Class C implements X, Y extends B { }

  5. 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:

Ensurepass 2018 PDF and VCE

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?

  1. Invalid Divisor

    Divisor Changed Successful Division 30

  2. Invalid Divisor Successful Division 30

  3. Invalid Divisor

    Exception in thread quot;mainquot; java.lang.ArithmeticException: / by zero at test.Teagle.main(Teagle.java:14)

  4. 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?

  1. sb.deleteAll();

  2. sb.delete(0, sb.size());

  3. sb.delete(0, sb.length());

  4. sb.removeAll();

Answer: C

100% Ensurepass Free Download!
Download Free Demo:1z0-803 Demo PDF
100% Ensurepass Free Guaranteed!
Download 2018 EnsurePass 1z0-803 Full Exam PDF and VCE

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

Leave a Reply

Your email address will not be published. Required fields are marked *