itshikenmondaiのブログ

試験のさまさまな情報をご紹介いたします

オラクル 1z0-803受験対策

1z0-803 試験の難易度は難しいと思います。自分の学習方法が見つからないと不安ですか?自分の学習方法を見つけるのは一番重要なのです。もし、使用している学習方法が適切でないと思えば、もっと効果的な方法に変更ほうがいいと思います。


ITshikenは Java SE 7 Programmer I 認定を取るための最善の勉強計画を提供します。


受験者は試験を受ける前に弊社の1z0-803 問題集を使えば、きっとパスことができます。弊社の1z0-803 問題集はお客様の試験を成功させるために保証し、IT専門家のグルプによって、作上げられてです。


ITshiken 1z0-803 受験対策は高価な講座を受ける必要はなく、10~20時間の独学だけで、一発合格が可能です。


ITshikenのソフト版は真実の1z0-803試験環境と同じので、トレーニングを繰り返していけば本試験では必ず結果は試験に合格することができます。


ITshikenの1z0-803試験資料は試験センターによって、よく更新し、無料サンプルを利用して、もっと自信を持って認定合格になります。



Question No : 1
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


正解: D
Explanation: The length of the element with index 0, {0, 1, 2}, is 3.Output: 3
The element with index 1, {3, 4, 5, 6}, is of type array.Output: true
The element with index 0, {0, 1, 2} has the element with index 1: 1.Output:


Question No : 2
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


正解: B
Explanation: After the statement jian = bob; the jian will reference the same object as bob.


Question No : 3
Given the code fragment:
String valid = "true";
if (valid) System.out.println (“valid”);
else system.out.println ("not valid");
What is the result?
A.Valid
B.not valid
C.Compilation fails
D.An IllegalArgumentException is thrown at run time


正解: C
Explanation: In segment 'if (valid)' valid must be of type boolean, but it is a string.
This makes the compilation fail.


Question No : 4
Given:
public class ScopeTest {
int z;
public static void main(String[] args){
ScopeTest myScope = new ScopeTest();
int z = 6;
System.out.println(z);
myScope.doStuff();
System.out.println(z);
System.out.println(myScope.z);
}
void doStuff() {
int z = 5;
doStuff2();
System.out.println(z);
}
void doStuff2() {
z=4;
}
}
What is the result?
A.6 5 6 4
B.6 5 5 4
C.6 5 6 6
D.6 5 6 5


正解: A
Explanation: Within main z is assigned 6.z is printed.Output: 6
Within doStuff z is assigned 5.DoStuff2 locally sets z to 4 (but MyScope.z is set to 4), but in
Dostuff z is still 5.z is printed.Output: 5
Again z is printed within main (with local z set to 6).Output: 6
Finally MyScope.z is printed.MyScope.z has been set to 4 within doStuff2().Output: 4


Question No : 5
Which two are valid instantiations and initializations of a multi dimensional array?
A.int [] [] array 2D = { { 0, 1, 2, 4} {5, 6}};
B.int [] [] array2D = new int [2] [2]; array2D[0] [0] = 1; array2D[0] [1] = 2; array2D[1] [0] = 3; array2D[1] [1] = 4;
C.int [] [] [] array3D = {{0, 1}, {2, 3}, {4, 5}};
D.int [] [] [] array3D = new int [2] [2] [2]; array3D [0] [0] = array; array3D [0] [1] = array; array3D [1] [0] = array; array3D [0] [1] = array;
E.int [] [] array2D = {0, 1};


正解: BD
Explanation: In the Java programming language, a multidimensional array is simply an array
whose components are themselves arrays.


Question No : 6
An unchecked exception occurs in a method dosomething()
Should other code be added in the dosomething() method for it to compile and execute?
A.The Exception must be caught
B.The Exception must be declared to be thrown.
C.The Exception must be caught or declared to be thrown.
D.No other code needs to be added.


正解: D
Explanation: Because the Java programming language does not require methods to catch or to
specify unchecked exceptions (RuntimeException, Error, and their subclasses), programmers may
be tempted to write code that throws only unchecked exceptions or to make all their exception
subclasses inherit from RuntimeException.Both of these shortcuts allow programmers to write
code without bothering with compiler errors and without bothering to specify or to catch any
exceptions.Although this may seem convenient to the programmer, it sidesteps the intent of the
catch or specify requirement and can cause problems for others using your classes.


Question No : 7
Given the code fragment:
int b = 4;
b -- ;
System.out.println (-- b);
System.out.println(b);
What is the result?
A.2 2
B.1 2
C.3 2
D.3 3


正解: A
Explanation: Variable b is set to 4.
Variable b is decreased to 3.
Variable b is decreased to 2 and then printed.Output: 2
Variable b is printed.Output: 2


Question No : 8
Given the code fragment:
interface SampleClosable {
public void close () throws java.io.IOException;
}
Which three implementations are valid?
A.public class Test implements SampleCloseable { public void close() throws java.io.IOException { / / do something } }
B.public class Test implements SampleCloseable { public void close() throws Exception { / / do something } }
C.public class Test implements SampleCloseable { public void close() throws java.io.FileNotFoundException { / / do something } }
D.public class Test extends SampleCloseable { public void close() throws java.I
E.IOException { / / do something } }
F.public class Test implements SampleCloseable { public void close() / / do something } }


正解: ACE
Explanation: A: Throwing the same exception is fine.
C: Using a subclass of java.io.IOException (here java.io.FileNotFoundException) is fine
E: Not using a throw clause is fine.


Question No : 9
Given the code fragment:
Int [] [] array = {{0}, {0, 1}, {0, 2, 4}, {0, 3, 6, 9}, {0, 4, 8, 12, 16}};
Systemout.printIn(array [4] [1]);
System.out.printIn (array) [1][4]);
int [] [] array = {{0}, {0, 1}, {0, 2, 4}, {0, 3, 6, 9}, {0, 4, 8, 12, 16}};
System.out.println(array [4][1]);
System.out.println(array) [1][4]);
What is the result?
A.4 Null
B.Null 4
C.An IllegalArgumentException is thrown at run time
D.4 An ArrayIndexOutOfBoundException is thrown at run time


正解: D
Explanation: The first println statement, System.out.println(array [4][1]);, works fine.It selects the
element/array with index 4, {0, 4, 8, 12, 16}, and from this array it selects the element with index 1,


Question No : 10
Given:
public class DoCompare1 {
public static void main(String[] args) {
String[] table = {"aa", "bb", "cc"};
for (String ss: table) {
int ii = 0;
while (ii < table.length) {
System.out.println(ss + ", " + ii);
ii++;
}
}
How many times is 2 printed as a part of the output?
A.Zero
B.Once
C.Twice
D.Thrice
E.Compilation fails.


正解: D
Explanation: The for statement, for (String ss: table), is executed one time for each of the three
elements in table.The while loop will print a 2 once for each element.
Output:
aa, 0
aa, 1
aa, 2
bb, 0
bb, 1
bb, 2
cc, 0
cc, 1
cc, 2


Question No : 11
Given:
import java.io.IOException;
public class Y {
public static void main(String[] args) {
try {
doSomething();
}
catch (RuntimeException e) {
System.out.println(e);
}
}
static void doSomething() {
if (Math.random() > 0.5) throw new IOException();
throw new RuntimeException();
}
}
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


正解: 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 No : 12
Given:
class X {
String str = "default";
X(String s) { str = s;}
void print () { System.out.println(str); }
public static void main(String[] args) {
new X("hello").print();
}
}
What is the result?
A.hello
B.default
C.Compilation fails
D.The program prints nothing
E.An exception is thrown at run time


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


Question No : 13
Given:
public class SampleClass {
public static void main(String[] args) {
AnotherSampleClass asc = new AnotherSampleClass();
SampleClass sc = new SampleClass();
// TODO code application logic here
}
}
class AnotherSampleClass extends SampleClass {
}
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 ()


正解: B
Explanation: Works fine.


Question No : 14
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


正解: 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 No : 15
Which code fragment is illegal?
A.class Base1 { abstract class Abs1 { }}
B.abstract class Abs1 { void doit () { } }
C.class Basel { abstract class Abs1 extends Basel {
D.abstract int var1 = 89;


正解: 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 be abstract[3].An abstract method
has no implementation; all classes containing abstract methods must themselves be abstract,
although not all abstract classes have abstract methods.