1z0 808 PDF
1z0 808 PDF
1z0 808 PDF
Java SE 8 Programmer I
Java 1Z0-808 Dumps Available Here at:
https://www.certification-questions.com/java-exam/1z0-808-dumps.html
Enrolling now you will get access to 433 questions in a unique set of 1Z0-
808 dumps
Question 1
Given the code fragment:
Options:
C. 5/4/14T00:00:00.000
Answer: D
Explanation:
ava.time.temporal.UnsupportedTemporalTypeException: Unsupported field: HourOfDay
Question 2
Given:
class Mid {
https://www.certification-questions.com
Java 1Z0-808
int n1 = 22, n2 = 2;
System.out.print(n3);
}
}
Which two code fragments, when inserted at // insert code here, enable the code to compile and print 12?
Options:
B. int n3 = super.findMid(n1,n3);
Answer: A, D
Explanation:
Incorrect:
Not B: circular definition of n3.
Not C: Compilation error. line Calc c = new Mid(); required: Calc found: Mid
Not E: Compilation error. line int n3 = Calc.findMid(n1, n2); non-static method findMid(int,int) cannot be
Question 3
Given:
https://www.certification-questions.com
Java 1Z0-808
Options:
A. The x field
B. The y field
Answer: C, E, F
Explanation:
he sum field and the two methods (setX and SetY) that updates the sum field.
Question 4
Which of the following can fill in the blank in this code to make it compile? (Select 2 options.)
Options:
https://www.certification-questions.com
Java 1Z0-808
Answer: A, C
Explanation:
Option A and C are the correct answer.
In a method declaration, the keyword throws is used. So here at line 1 we have to use option A. To actually
throw an exception, the keyword throw is used and a new exception is created, so at line 2 we have to use
throw and new keywords, which is option C. Finally it will look like; public void method() throws Exception
{ throw new Exception0; }
Reference : http://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#
Question 5
Which statement is true about the default constructor of a top-level class?
Options:
C. It can be overloaded.
D. The default constructor of a subclass always invokes the no-argument constructor of its
superclass.
Answer: D
Explanation:
In both Java and C#, a "default constructor" refers to a nullary constructor that is automatically generated
by the compiler if no constructors have been defined for the class. The default constructor is also empty,
meaning that it does nothing. A programmer-defined constructor that takes no parameters is also called a
default constructor.
Question 6
Given:
public class MyClass {
public static void main(String[] args) {
while (int ii = 0; ii < 2) {
ii++;
System.out.println("ii = " + ii);
}
}
}
https://www.certification-questions.com
Java 1Z0-808
Options:
A. ii = 1 ii = 2
B. Compilation fails
Answer: B
Explanation:
The while statement is incorrect. It has the syntax of a for statement. The while statement continually
executes a block of statements while a particular condition is true. Its syntax can be expressed as:
while (expression) { statement(s)
}
The while statement evaluates expression, which must return a boolean value. If the expression evaluates
to true, the while statement executes the statement(s) in the while block. The while statement continues
testing the expression and executing its block until the expression evaluates to false.
Reference: The while and do-while Statements
Question 7
Given:
Options:
https://www.certification-questions.com
Java 1Z0-808
A. 1
B. 2
C. 3
D. 4
Answer: B
Explanation:
obj1 and obj3.
when you do obj2 = obj1 you're copying object references - you're not making a copy of the object - and so
the
variables obj1 and obj2 will both point to the same object.
Question 8
Given the classes:
* AssertionError
* ArithmeticException
* ArrayIndexOutOfBoundsException
* FileNotFoundException
* IllegalArgumentException
* IOError
* IOException
* NumberFormatException
* SQLException
Which option lists only those classes that belong to the unchecked exception category?
Options:
A. ArrayIndexOutOfBoundsException, ArithmeticException
Answer: A
Explanation:
https://www.certification-questions.com
Java 1Z0-808
Not B: IOError and IOException are both checked errors. Not C, not D, not E: FileNotFoundException is a
checked error.
Note:
Checked exceptions:
* represent invalid conditions in areas outside the immediate control of the program (invalid user input,
database problems, network outages, absent files)
* are subclasses of Exception
* a method is obliged to establish a policy for all checked exceptions thrown by its implementation (either
pass the checked exception further up the stack, or handle it somehow) Note:
Unchecked exceptions:
* represent defects in the program (bugs) - often invalid arguments passed to a non-private method. To
quote from The Java Programming Language, by Gosling, Arnold, and Holmes: "Unchecked runtime
exceptions represent conditions that, generally speaking, reflect errors in your program's logic and cannot
be reasonably recovered from at run time."
* are subclasses of RuntimeException, and are usually implemented using IllegalArgumentException,
NullPointerException, or IllegalStateException
* method is not obliged to establish a policy for the unchecked exceptions thrown by its implementation
(and they almost always do not do so)
Question 9
Given:
abstract class X {
public abstract void methodX();
}
interface Y{
public void methodY();
}
https://www.certification-questions.com
Java 1Z0-808
Options:
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: B, C, D
Explanation:
When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract
methods in its parent class (C). However, if it does not, then the subclass must also be declared abstract
(B)(D).
Note: An abstract class is a class that is declared abstract--it may or may not include abstract methods.
Abstract classes cannot be instantiated, but they can be subclassed.
Question 10
Which of the following data types will allow the following code snippet to compile?
float i=4;
float j=2;
____z=i+j;
Options:
A. long
B. double
C. int
D. float
https://www.certification-questions.com
Java 1Z0-808
E. byte
Answer: B, D
Explanation:
Option B and D are the correct answer.
Since the variables i and j are floats, resultant will be float type too. So we have to use float or primitive
type which can hold float, such a primitive type is double, it has wider range and also can hold floating
point numbers, hence we can use double or float for the blank. As explained above options B and D are
correct. long and int can't be used with floating point numbers so option A is incorrect. Option E is incorrect
as it have smaller range and also can't be used with floating point numbers.
Reference:http://docs.oracle.com/javase/tutorial/java/javaOO/variables.html
Would you like to see more? Don't miss our 1Z0-808 PDF
file at:
https://www.certification-questions.com/java-pdf/1z0-808-pdf.html
https://www.certification-questions.com