[2016-May-NEW]New Official 1Z0-803 Study Guide PDF Free Shared By Braindump2go Today[NQ1-NQ10]

2016 May Oracle Official News – 1Z0-803: Java SE 7 Programmer I Exam Questions New Updated Today! Braindump2go.com Offers 1Z0-803 New Questions and Answers for Free Download!

NEW QUESTION 1 – NEW QUESTION 10

 

QUESTION 1
Given:
 
Which two actions, used independently, will permit this class to compile?

A.    Adding throws IOException to the main() method signature
B.    Adding throws IOException to the doSoomething() method signature
C.    Adding throws IOException to the main() method signature and to the dosomething() method
D.    Adding throws IOException to the dosomething() method signature and changing the catch argument
to IOException
E.    Adding throws IOException to the main() method signature and changing the catch argument to IOException

Answer: CD
Explanation:
The IOException must be caught or be declared to be thrown.
We must add a throws exception to the doSomething () method signature (static void
doSomething() throws IOException).
Then we can either add the same throws IOException to the main method (public static void
main(String[] args) throws IOException), or change the catch statement in main to IOException.

QUESTION 2
Given:
 
What is the result?

A.    hello
B.    default
C.    Compilation fails
D.    The program prints nothing
E.    An exception is thrown at run time

Answer: A
Explanation:
The program compiles fine.
The program runs fine.
The output is: hello

QUESTION 3
Given:
 
Which statement, when inserted into line “// TODO code application logic here “, is valid change?

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

Answer: B
Explanation:
Works fine.
Incorrect answers:
asc = sc.clone();
Incompatible types.
asc =sc;
Incompatible types.
asc = (object) sc;
Syntax error

QUESTION 4
Given the code fragment:
System.out.println(“Result: ” + 2 + 3 + 5);
System.out.println(“Result: ” + 2 + 3 * 5);
What is the result?

A.    Result: 10
Result: 30
B.    Result: 10
Result: 25
C.    Result: 235
Result: 215
D.    Result: 215
Result: 215
E.    Compilation fails

Answer: C
Explanation:
First line:
System.out.println(“Result: ” + 2 + 3 + 5);
String concatenation is produced.
Second line:
System.out.println(“Result: ” + 2 + 3 * 5);
3*5 is calculated to 15 and is appended to string 2. Result 215.
The output is:
Result: 235
Result: 215
Note #1:
To produce an arithmetic result, the following code would have to be used:
System.out.println(“Result: ” + (2 + 3 + 5));
System.out.println(“Result: ” + (2 + 1 * 5));
run:
Result: 10
Result: 7
Note #2:
If the code was as follows:
System.out.println(“Result: ” + 2 + 3 + 5″);
System.out.println(“Result: ” + 2 + 1 * 5″);
The compilation would fail. There is an unclosed string literal, 5″, on each line.

QUESTION 5
Which code fragment is illegal?
 

A.    Option A
B.    Option B
C.    Option C
D.    Option D

Answer: D
Explanation:
The abstract keyword cannot be used to declare an int variable.
The abstract keyword is used to declare a class or method to beabstract[3]. An abstract method
has no implementation; all classes containing abstract methods must themselves be abstract,
although not all abstract classes have abstract methods.

QUESTION 6
Given:
 
What is the result?

A.    There is no output
B.    d is output
C.    A StringIndexOutOfBoundsException is thrown at runtime
D.    An ArrayIndexOutOfBoundsException is thrown at runtime
E.    A NullPointException is thrown at runtime
F.    A StringArrayIndexOutOfBoundsException is thrown at runtime

Answer: C
Explanation:
There are only 11 characters in the string “Hello World”.
The code theString.charAt(11) retrieves the 12th character, which does not exist.
A StringIndexOutOfBoundsException is thrown.
Exception in thread “main” java.lang.StringIndexOutOfBoundsException:
String index out of range: 11

QUESTION 7
Given the code fragment:
int a = 0;
a++;
System.out.println(a++);
System.out.println(a);
What is the result?

A.    1
2
B.    0
1
C.    1
1
D.    2
2

Answer: A
Explanation:
The first println prints variable a with value 1 and then increases the variable to 2.

QUESTION 8
Given a java source file:
 
What changes will make this code compile?

A.    adding the public modifier to the declaration ofclass x
B.    adding the protected modifier to the x()constructor
C.    changing the private modifier on the declarationof the one() method to protected
D.    removing the Y () constructor
E.    removing the private modifier from the two () method

Answer: C
Explanation:
Using the private protected, instead of the private modifier, for the declaration of the one() method, would enable the two() method to access the one() method.

QUESTION 9
Given:
 
What is the result?

A.    They match
They really match
B.    They really match
C.    They match
D.    Nothing Prints
E.    They really match
They really match

Answer: B
Explanation:
The strings are not the same objects so the == comparison fails.
See note #1 below.
As the value of the strings are the same equals is true.
The equals method compares values for equality.
Note: #1 ==
Compares references, not values.
The use of == with object references is generally limited to the following:
Comparing to see if a reference is null.
Comparing two enum values.
This works because there is only one object for each enum constant.
You want to know if two references are to the same object.

QUESTION 10
Given:
 
What three modifications, made independently, made to class greet, enable the code to compile and run?

A.    Line 6 replaced with handy.dandy.keystroke stroke = new KeyStroke ( );
B.    Line 6 replaced with handy.*.KeyStroke = new KeyStroke ( );
C.    Line 6 replaced withhandy.dandy.KeyStroke Stroke = new handy.dandy.KeyStroke();
D.    import handy.*;addedbeforeline 1
E.    import handy.dandy.*;added after line 1
F.    import handy.dandy,KeyStroke;added after line 1
G.    import handy.dandy.KeyStroke.typeException(); added before line 1

Answer: CEF
Explanation:
Three separate solutions:
C: the full class path to the method must be stated (when we have not imported the package)
E: We can import the hold dandy class
F: we can import the specific method


2016 Valid Oracle 1Z0-803 Exam Study Materials:

1.| Latest 1Z0-803 Exam VCE and PDF Dumps 271q from Braindump2go: http://www.braindump2go.com/1z0-803.html [100% Exam Pass Guaranteed!]

2.| New 1Z0-803 Exam Questions and Answers – Google Drive: https://drive.google.com/folderview?id=0B75b5xYLjSSNTUpTSzVyeEw0WW8&usp=sharing

 

MORE Practice is the Most Important IF You want to PASS 70-341 Exam 100%!
————— Braindump2go.com
————— Pass All IT Exams at the first Try!