web analytics

[Premium](100% Valid) Real Oracle 1Z0-803 Test Questions Offered By Passleader Help Passing Exam Easily (91-105)

Tips For 100% Pass Exam 1Z0-803: PassLeader are providing updated and guaranteed 1Z0-803 169q braindumps for your Oracle 1Z0-803 Exam, we ensure the 1Z0-803 169q exam questions are the latest, and will help you passing exam easily. Visit passleader.com and get the free 1Z0-803 169q vce and pdf dumps with free VCE Player.

PassLeader 1Z0-803 Braindumps[17]

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

QUESTION 91
Given the code fragment:
int b = 3;
if ( !(b > 3)) {
System.out.println("square");
}{
System.out.println("circle");
}
System.out.println("…");
What is the result?

A.    square…
B.    circle…
C.    squarecircle…
D.    Compilation fails.

Answer: C

QUESTION 92
What is the proper way to defined a method that take two int values and returns their sum as an int value?

A.    int sum(int first, int second) { first + second; }
B.    int sum(int first, second) { return first + second; }
C.    C. sum(int first, int second) { return first + second; }
D.    D. int sum(int first, int second) { return first + second; }
E.    void sum (int first, int second) { return first + second; }

Answer: D

QUESTION 93
Which two are Java Exception classes?

A.    SercurityException
B.    DuplicatePathException
C.    IllegalArgumentException
D.    TooManyArgumentsException

Answer: AC

QUESTION 94
Given the for loop construct:
for ( expr1 ; expr2 ; expr3 ) {
statement;
}
Which two statements are true?

A.    This is not the only valid for loop construct; there exits another form of for loop constructor.
B.    The expression expr1 is optional. it initializes the loop and is evaluated once, as the loop begin.
C.    When expr2 evaluates to false, the loop terminates. It is evaluated only after each iteration through the loop.
D.    The expression expr3 must be present. It is evaluated after each iteration through the loop.

Answer: BC

QUESTION 95
What is the result?
public class StringReplace {
public static void main(String[] args) {
String message = "Hi everyone!";
System.out.println("message = " + message.replace("e", "X")); }
}

A.    message = Hi everyone!
B.    message = Hi XvXryonX!
C.    A compile time error is produced.
D.    A runtime error is produced.
E.    message =
F.    message = Hi Xveryone!

Answer: B

QUESTION 96
Which two statements are true for a two-dimensional array?

A.    It is implemented as an array of the specified element type.
B.    Using a row by column convention, each row of a two-dimensional array must be of the same size
C.    At declaration time, the number of elements of the array in each dimension must be specified
D.     All methods of the class Object may be invoked on the two-dimensional array.

Answer: AD

QUESTION 97
Which three statements are benefits of encapsulation?

A.    allows a class implementation to change without changing t he clients
B.    protects confidential data from leaking out of the objects
C.    prevents code from causing exceptions
D.    enables the class implementation to protect its invariants
E.    permits classes to be combined into the same package
F.    enables multiple instances of the same class to be created safely

Answer: ABD


PassLeader 1Z0-803 Braindumps[26]

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

QUESTION 98
Given the code fragment:
1. ArrayList<Integer> list = new ArrayList<>(1);
2. list.add(1001);
3. list.add(1002);
4. System.out.println(list.get(list.size()));
What is the result?

A.    Compilation fails due to an error on line 1.
B.    An exception is thrown at run time due to error on line 3
C.    An exception is thrown at run time due to error on line 4
D.    1002

Answer: C

QUESTION 99
View the Exhibit.
public class Hat {
public int ID =0;
public String name = "hat";
public String size = "One Size Fit All";
public String color="";
public String getName() { return name; }
public void setName(String name) {
this.name = name;
}
}
Given:
public class TestHat {
public static void main(String[] args) {
Hat blackCowboyHat = new Hat();
}
}
Which statement sets the name of the Hat instance?

A.    blackCowboyHat.setName = "Cowboy Hat";
B.    setName("Cowboy Hat");
C.    Hat.setName("Cowboy Hat");
D.    blackCowboyHat.setName("Cowboy Hat");

Answer: D

QUESTION 100
Which code fragment cause a compilation error?

A.    float flt = 100F;
B.    float flt = (float) 1_11.00;
C.    float flt = 100;
D.    double y1 = 203.22;
float flt = y1;
E.    int y2 = 100;
float flt = (float) y2;

Answer: D

QUESTION 101
Given the code fragment:
String[] colors = {"red", "blue", "green", "yellow", "maroon", "cyan"};
Which code fragment prints blue, cyan, ?

A.    for (String c:colors) {
if (c.length() != 4) {
continue;
}
System.out.print(c + ", ");
}
B.    for (String c:colors[]) {
if (c.length() <= 4) {
continue;
}
System.out.print(c + ", ");
}
C.    for (String c: String[] colors) {
if (c.length() >= 3) {
continue;
}
System.out.print(c + ", ");
}
D.    for (String c:colors) {
if (c.length() != 4) {
System.out.print(c + ", ");
continue;
}
}

Answer: A

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

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

Answer: C

QUESTION 103
Given:
1. public class SampleClass {
2. public static void main (String[] args) {
3. AnotherSampleClass asc = new AnotherSampleClass();
4. SampleClass sc = new SampleClass();
5. // insert code here
6. }
7. }
8. class AnotherSampleClass extends SampleClass {
9. }
Which statement, when inserted into line 5, enables the code to compile?

A.    asc = sc;
B.    sc = asc;
C.    asc = (Object) sc;
D.    asc = sc.clone;

Answer: B

QUESTION 104
Which statement will empty the contents of a StringBuilder variable named sb?

A.    sb.deleteAll;
B.    sb.delete(0, sb.size());
C.    sb.delete(0, sb.length());
D.    sb.removeAll();

Answer: C

QUESTION 105
Given:
class MarksOutOfBoundsException extends IndexOutOfBoundsException { } public class GradingProcess {
void verify(int marks) throws IndexOutOfBoundsException { if (marks > 100) {
throw new MarksOutOfBoundsException();
}
if (marks > 50) {
System.out.print("Pass");
} else {
System.out.print("Fail");
}
}
public static void main(String[] args) {
int marks = Integer.parseInt(args[2]);
try {
new GradingProcess().verify(marks);
} catch (Exception e) {
System.out.print(e.getClass());
}
}
}
And the command line invocation:
java GradingProcess 89 50 104
What is the result?

A.    Pass
B.    Fail
C.    class MarksOutOfBoundsException
D.    class IndexOutOfBoundsException
E.    class Excpetion

Answer: C


PassLeader 1Z0-803 Braindumps[27]

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

Welcome To Visit PassLeader