Online Access Free 1Z0-851 Exam Questions

Exam Code:1Z0-851
Exam Name:Java Standard Edition 6 Programmer Certified Professional Exam
Certification Provider:Oracle
Free Question Number:290
Posted:Dec 09, 2025
Rating
100%

Question 1

Given:
10.abstract public class Employee {
11.protected abstract double getSalesAmount();
12.public double getCommision() {
13.return getSalesAmount() * 0.15;
14.}
15.}
16.class Sales extends Employee {
17.// insert method here
18.}
Which two methods, inserted independently at line 17, correctly complete the Sales class? (Choose two.)

Question 2

Given:
11.public class Test {
12.public static void main(String [] args) {
13.int x = 5;
14.boolean b1 = true;
15.boolean b2 = false;
16.17.
if ((x == 4) && !b2 )
18.System.out.print("1 ");
19.System.out.print("2 ");
20.if ((b2 = true) && b1 )
21.System.out.print("3 ");
22.}
23.}
What is the result?

Question 3

Given:
5.class Atom {
6.Atom() { System.out.print("atom "); }
7.}
8.class Rock extends Atom {
9.Rock(String type) { System.out.print(type); }
10.}
11.public class Mountain extends Rock {
12.Mountain() {
13.super("granite ");
14.new Rock("granite ");
15.}
16.public static void main(String[] a) { new Mountain(); }
17.}
What is the result?

Question 4

Given:
5.import java.util.Date;
6.import java.text.DateFormat;
21.DateFormat df;
22.Date date = new Date();
23.// insert code here
24.String s = df.format(date);
Which code fragment, inserted at line 23, allows the code to compile?

Question 5

Given:
1.interface DoStuff2 {
2.float getRange(int low, int high); }
3.4.
interface DoMore {
5.float getAvg(int a, int b, int c); }
6.7.
abstract class DoAbstract implements DoStuff2, DoMore { }
8.9.
class DoStuff implements DoStuff2 {
10.public float getRange(int x, int y) { return 3.14f; } }
11.12.
interface DoAll extends DoMore {
13.float getAvg(int a, int b, int c, int d); } What is the result?

Add Comments

Your email address will not be published. Required fields are marked *

insert code
Type the characters from the picture.