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

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: 141

Given:

Ensurepass 2018 PDF and VCE

What is the result?

  1. 2 1

  2. 2 1

    0

  3. null

  4. an infinite loop

  5. compilation fails

Answer: E Explanation:

The line while (-ii); will cause the compilation to fail. ii is not aboolean value.

A correct line would be while (-iigt;0);

Question No: 142

Given the code fragment:

Ensurepass 2018 PDF and VCE

Which code fragment, when inserted at // insert code here, enables the code to compile and and print a b c?

  1. List update (String[] strs)

  2. Static ArrayListupdate(String [] strs)

  3. Static List update (String [] strs)

  4. Static void update (String[] strs)

  5. ArrayList static update(String [] strs)

Answer: E

Question No: 143

Given:

Ensurepass 2018 PDF and VCE

Which constructor initializes the variable x3?

  1. Only the default constructor of class X

  2. Only the no-argument constructor of class Y

  3. Only the no-argument constructor of class Z

  4. Only the default constructor of object class

Answer: C

Question No: 144

ON NO: 75

View the exhibit:

public class Student { public String name = quot;quot;; public int age = 0;

public String major = quot;Undeclaredquot;; public boolean fulltime = true; public void display() {

System.out.println(quot;Name: quot; name quot; Major: quot; major); } publicboolean isFullTime() {

return fulltime;

}

}

Given:

Public class TestStudent {

public static void main(String[] args) { Student bob = new Student (); bob.name = quot;Bobquot;;

bob.age = 18;

bob.year = 1982;

}

}

What is the result?

  1. year is set to 1982.

  2. bob.year is set to 1982

  3. A runtime error is generated.

  4. A compile time error is generated.

Answer: D

Question No: 145

Given:

public class TestField { int x;

int y;

public void doStuff(int x, int y) { this.x = x;

y =this.y;

}

public void display() { System.out.print(x quot; quot; y quot; : quot;);

}

public static void main(String[] args) { TestField m1 = new TestField(); m1.x = 100;

m1.y = 200;

TestField m2 = new TestField(); m2.doStuff(m1.x, m1.y); m1.display();

m2.display();

}

}

What is the result?

A. 100 200 : 100 200

B. 100 0 : 100 0 :

C. 100 200 : 100 0 :

D. 100 0 : 100 200 :

Answer: C

Question No: 146

Which two are valid array declaration?

  1. Object array[];

  2. Boolean array[3];

  3. int[] array;

  4. Float[2] array;

Answer: A,C

Question No: 147

The protected modifier on a Field declaration within a public class means that the field

.

  1. Cannot be modified

  2. Can be read but not written from outside the class

  3. Can be read and written from this class and its subclasses only within the same package

  4. Can be read and written from this class and its subclasses defined in any package

Answer: D

Reference:

http://beginnersbook.com/2013/05/java-access-modifiers/

Question No: 148

A method doSomething () that has no exception handling code is modified to trail a method that throws achecked exception. Which two modifications, made independently, will allow the program to compile?

  1. Catch the exception in the method doSomething().

  2. Declare the exception to be thrown in the doSomething() method signature.

  3. Cast the exception to aRunTimeException in the doSomething() method.

  4. Catch the exception in the method that calls doSomething().

Answer: A,B

Explanation: Valid Java programming language code must honor the Catch or Specify Requirement. This means that code that might throw certain exceptions must be enclosed by either of the following:

  • A try statement that catches the exception. The try must provide a handler for the exception, as described in Catching and Handling Exceptions.

  • A method that specifies that it can throw the exception. The method must provide a throws clause that lists the exception, as described in Specifying the Exceptions Thrown by a Method.

  • Code that fails to honor the Catch or Specify Requirement will not compile.

    Question No: 149

    Given:

    Ensurepass 2018 PDF and VCE

    What is the result?

    1. One

    2. Two

    3. Three

    4. Compilation fails

    Answer: D

    Question No: 150

    Given:

    interface Pet { }

    class Dog implements Pet { } public class Beagle extends Dog{ }

    Which three are valid?

    1. Pet a = new Dog();

    2. Pet b = new Pet();

    3. Dog f = new Pet();

    4. Dog d = new Beagle();

    5. Pet e = new Beagle();

    6. Beagle c = new Dog();

    Answer: A,D,E Explanation: Incorrect:

    Not B, not C: Pet is abstact, cannot be instantiated. Not F: incompatible type. Required Beagle, found Dog.

    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 *