web analytics

[Premium](100% Valid) PassLeader Oracle 1Z0-803 Study Materials With Real Exam Questions And Answers (31-45)

Info For 1Z0-803 Exam 100% Pass: PassLeader provides you with the newest 1Z0-803 169q exam questions updated in recent days to prepare your 1Z0-803 certification exams. Our best 1Z0-803 169q exam dumps will offer you the newest questions and answers with premium VCE and PDF format to download. And PassLeader also offer you the latest free version VCE Player!

PassLeader 1Z0-803 Braindumps[21]

Vendor: Oracle
Exam Code: 1Z0-803
Exam Name: Java SE 7 Programmer I

QUESTION 31
Given:
public class SuperTest {
public static void main(String[] args) {
statement1
statement2
statement3
}
}

class Shape {
public Shape() {
System.out.println("Shape: constructor");
}
public void foo() {
System.out.println("Shape: foo");
}
}
class Square extends Shape {
public Square() {
super();
}
public Square(String label) {
System.out.println("Square: constructor");
}
public void foo() {
super.foo();
}
public void foo(String label) {
System.out.println("Square: foo");
}
}
What should statement1, statement2, and statement3, be respectively, in order to produce the result?
Shape: constructor
Square: foo
Shape: foo

A.    Square square = new Square ("bar");
square.foo ("bar");
square.foo();
B.    Square square = new Square ("bar");
square.foo ("bar");
square.foo ("bar");
C.    Square square = new Square ();
square.foo ();
square.foo(bar);
D.    Square square = new Square ();
square.foo ();
square.foo("bar");
E.    Square square = new Square ();
square.foo ();
square.foo ();
F.    Square square = new Square();
square.foo("bar");
square.foo();

Answer: F

QUESTION 32
Give:
Public Class Test {
}
Which two packages are automatically imported into the java source file by the java compiler?

A.    Java.lang
B.    Java.awt
C.    Javax.net
D.    Java.*
E.    The package with no name

Answer: AE

QUESTION 33
Given:
public class X implements Z {
public String toString() { return "I am X"; }
public static void main(String[] args) {
Y myY = new Y();
X myX = myY;
Z myZ = myX;
System.out.println(myZ);
}
}
class Y extends X {
public String toString() { return "I am Y"; }
}
interface Z {}
What is the reference type of myZ and what is the type of the object it references?

A.    Reference type is Z; object type is Z.
B.    Reference type is Y; object type is Y.
C.    Reference type is Z; object type is Y.
D.    Reference type is X; object type is Z.

Answer: C

QUESTION 34
Given:
341_thumb[1]
What is the result?

A.    sc: class.Object
asc: class.AnotherSampleClass
B.    sc: class.SampleClass
asc: class.AnotherSampleClass
C.    sc: class.AnotherSampleClass
asc: class.SampleClass
D.    sc: class.AnotherSampleClass
asc: class.AnotherSampleClass

Answer: D

QUESTION 35
Given the code fragment:
public static void main(String[] args) {
String [] table = {"aa", "bb", "cc"};
int ii = 0;
for (String ss:table) {
while (ii < table.length) {
System.out.println (ii);
ii++;
break;
}
}
}
How many times is 2 printed?

A.    zero
B.    once
C.    twice
D.    thrice
E.    it is not printed because compilation fails

Answer: B

QUESTION 36
Given:
public class SampleClass {
public static void main(String[] args) {
SampleClass sc, scA, scB;
sc = new SampleClass();
scA = new SampleClassA();
scB = new SampleClassB();
System.out.println("Hash is : " +
sc.getHash() + ", " + scA.getHash() + ", " + scB.getHash());
}
public int getHash() {
return 111111;
}
}
class SampleClassA extends SampleClass {
public long getHash() {
return 44444444;
}
}
class SampleClassB extends SampleClass {
public long getHash() {
return 999999999;
}
}
What is the result?

A.    Compilation fails
B.    An exception is thrown at runtime
C.    There is no result because this is not correct way to determine the hash code
D.    Hash is: 111111, 44444444, 999999999

Answer: A

QUESTION 37
Which two will compile, and can be run successfully using the command:
Java fred1 hello walls

A.    class Fred1{
public static void main (String args) {
System.out.println(args[1]);
}
}
B.    class Fred1{
public static void main (String [] args) {
System.out.println(args[2]);
}
}
C.    class Fred1 {
public static void main (String [] args) {
System.out.println (args);
}
}
D.    class Fred1 {
public static void main (String [] args){
System.out.println (args [1]);
}
}

Answer: CD


PassLeader 1Z0-803 Braindumps[30]

http://www.passleader.com/1z0-803.html

QUESTION 38
Given:
public abstract class Wow {
private int wow;
public wow (int wow) {
this.wow = wow;
}
public void wow () {}
private void wowza () {}
}
What is true about the class Wow?

A.    It compiles without error.
B.    It does not compile because an abstract class cannot have private methods.
C.    It does not compile because an abstract class cannot have instance variables.
D.    It does not compile because an abstract class must have at least one abstract method.
E.    It does not compile because an abstract class must have a constructor with no arguments.

Answer: C

QUESTION 39
Given:
class X {
static void m(int i) {
}
public static void main (String [] args) {
int j = 12;
m (j);
System.out.println(j);
}
}
What is the result?

A.    7
B.    12
C.    19
D.    Compilation fails
E.    An exception is thrown at run time

Answer: B

QUESTION 40
Which two statements are true?

A.    An abstract class can implement an interface.
B.    An abstract class can be extended by an interface.
C.    An interface CANNOT be extended by another interface.
D.    An interface can be extended by an abstract class.
E.    An abstract class can be extended by a concrete class.
F.     An abstract class CANNOT be extended by an abstract class.

Answer: AE

QUESTION 41
Given:
class Overloading {
int x(double d) {
System.out.println("one");
return 0;
}
String x(double d) {
System.out.println("two");
return null;
}
double x(double d) {
System.out.println("three");
return 0.0;
}
public static void main(String[] args) {
new Overloading().x(4.0)
}
}
What is the result?

A.    One
B.    Two
C.    Three
D.    Compilation fails

Answer: D

QUESTION 42
The catch clause argument is always of type___________.

A.    Exception
B.    Exception but NOT including RuntimeException
C.    Throwable
D.    RuntimeException
E.    CheckedException
F.    Error

Answer: C

QUESTION 43
Given:
public class x{
public static void main (string [] args){
String theString = "Hello World";
System.out.println(theString.charAt(11));
}
}
What is the result?

A.    There is no output
B.    d is output
C.    AStringIndexOutOfBoundsException is thrown at runtime
D.    AnArrayIndexOutOfBoundsException is thrown at runtime
E.    A NullPointException is thrown at runtime
F.    A StringArrayIndexOutOfBoundsException is thrown at runtime

Answer: C

QUESTION 44
Given the code fragment:
int [] [] array2D = {{0, 1, 2}, {3, 4, 5, 6}};
system.out.print (array2D[0].length+ "" );
system.out.print(array2D[1].getClass(). isArray() + "");
system.out.println (array2D[0][1]);
What is the result?

A.    3false1
B.    2true3
C.    2false3
D.    3true1
E.    3false3
F.    2true1
G.    2false1

Answer: D

QUESTION 45
View the exhibit:
public class Student {
public String name = "";
public int age = 0;
public String major = "Undeclared";
public boolean fulltime = true;
public void display() {
System.out.println("Name: " + name + " Major: " + major);
}
public boolean isFullTime() {
return fulltime;
}
}
Given:
Public class TestStudent {
Public static void main(String[] args) {
Student bob = new Student ();
Student jian = new Student();
bob.name = "Bob";
bob.age = 19;
jian = bob; jian.name = "Jian";
System.out.println("Bob’s Name: " + bob.name);
}
}
What is the result when this program is executed?

A.    Bob’s Name: Bob
B.    Bob’s Name: Jian
C.    Nothing prints
D.    Bob’s name

Answer: B


PassLeader 1Z0-803 Braindumps[13]

http://www.passleader.com/1z0-803.html