Welcome to TestSimulate

Pass Your Next Certification Exam Fast!

Everything you need to prepare, learn & pass your certification exam easily.

365 days free updates. First attempt guaranteed success.

Oracle Java Certified Programmer (1Z0-501) Free Practice Test

Question 1
Which is a method of the MouseMotionListener interface?

Correct Answer: E
Question 2
Exhibit:
1 . import java.io.IOException;
2 . public class ExceptionTest(
3 . public static void main (String[]args)
4 . try (
5 . methodA();
6 .) catch (IOException e)(
7 . system.out.printIn("Caught IOException");
8 .) catch (Exception e)(
9 . system.out.printIn("Caught Exception");
1 0.)
1 1. )
1 2. public void methodA (){
1 3. throw new IOException ();
14.)
15. )
What is the result?

Correct Answer: C
Question 3
Given:
1 . public class Foo {
2 . private int val;
3 . public foo(int v) (val = v;)}
4 . public static void main (String [] args){
5 . Foo a = new Foo (10);
6 . Foo b = new Foo (10);
7 . Foo c = a;
8 . int d = 10;
9 . double e = 10.0;
1 0. }
1 1. }
Which three logical expression evaluate to true? (Choose Three)

Correct Answer: A,D,F
Question 4
Which constructs a BufferedIputStream?

Correct Answer: D
Question 5
Which statements about static inner classes are true? (Choose Two)

Correct Answer: A,B
Question 6
Given:
1. public class Foo {
2 . public static void main (String [] args){
3 .StringBuffer a = new StringBuffer ("A");
4 .StringBuffer b = new StringBuffer ("B");
5 .operate (a,b);
6 .system.out.printIn{a + "," +b};
7 . )
8 . static void operate (StringBuffer x, StringBuffer y){
9 .x.append {y};
1 0.y = x;
1 1.)
1 2.}
What is the result?

Correct Answer: C
Question 7
Given:
1 . public class ArrayTest {
2 . public static void main (String[]args){
3 . float f1[], f2[];
4 . f1 = new float [10];
5 . f2 = f1;
6 . System.out.printIn ("f2[0]=" + f2[0]);
7 .}
8 .}
What is the result?

Correct Answer: B
Question 8
Which can be used to encode charS for output?

Correct Answer: D