1Z0-851 무료 덤프문제 온라인 액세스
시험코드: | 1Z0-851 |
시험이름: | Java Standard Edition 6 Programmer Certified Professional Exam |
인증사: | Oracle |
무료 덤프 문항수: | 290 |
업로드 날짜: | 2025-08-31 |
Given:
3.interface Animal { void makeNoise(); }
4.class Horse implements Animal {
5.Long weight = 1200L;
6.public void makeNoise() { System.out.println("whinny"); }
7.}
8.public class Icelandic extends Horse {
9.public void makeNoise() { System.out.println("vinny"); }
10.public static void main(String[] args) {
11.Icelandic i1 = new Icelandic();
12.Icelandic i2 = new Icelandic();
13.Icelandic i3 = new Icelandic();
14.i3 = i1; i1 = i2; i2 = null; i3 = i1;
15.}
16.}
When line 15 is reached, how many objects are eligible for the garbage collector?
Given:
11.public class PingPong implements Runnable {
12.synchronized void hit(long n) {
13.for(int i = 1; i < 3; i++)
14.System.out.print(n + "-" + i + " ");
15.}
16.public static void main(String[] args) {
17.new Thread(new PingPong()).start();
18.new Thread(new PingPong()).start();
19.}
20.public void run() {
21.hit(Thread.currentThread().getId());
22.}
23.}
Which two statements are true? (Choose two.)
Given:
5.class A {
6.void foo() throws Exception { throw new Exception(); }
7.}
8.class SubB2 extends A {
9.void foo() { System.out.println("B "); }
10.}
11.class Tester {
12.public static void main(String[] args) {
13.A a = new SubB2();
14.a.foo();
15.}
16.}
What is the result?