Free Oracle 1Z0-851 Exam Dumps Questions & Answers
| Exam Code/Number: | 1Z0-851Join the discussion |
| Exam Name: | Java Standard Edition 6 Programmer Certified Professional Exam |
| Certification: | Oracle |
| Free Question Number: | 290 |
| Publish Date: | Aug 17, 2026 |
| # of views: | 3580 |
|
|
|
Given
11.public interface Status {
12./* insert code here */ int MY_VALUE = 10;
13.} Which three are valid on line
12.(Choose three.)
Given:
11.class Alpha {
12.public void foo() { System.out.print("Afoo "); }
13.}
14.public class Beta extends Alpha {
15.public void foo() { System.out.print("Bfoo "); }
16.public static void main(String[] args) {
17.Alpha a = new Beta();
18.Beta b = (Beta)a;
19.a.foo();
20.b.foo();
21.}
22.}
What is the result?
Given:
1.public class Threads2 implements Runnable {
2.3.
public void run() {
4.System.out.println("run.");
5.throw new RuntimeException("Problem");
6.}
7.public static void main(String[] args) {
8.Thread t = new Thread(new Threads2());
9.t.start();
10.System.out.println("End of method.");
11.}
12.}
Which two can be results? (Choose two.)
Given:
1.public class GC {
2.private Object o;
3.private void doSomethingElse(Object obj) { o = obj; }
4.public void doSomething() {
5.Object o = new Object();
6.doSomethingElse(o);
7.o = new Object();
8.doSomethingElse(null);
9.o = null;
10.}
11.}
When the doSomething method is called, after which line does the Object created in line 5 become available for garbage collection?