Question: Which lines that are marked will compile in the following code? Select the five correct answers. (a) (1) (b) (2) (c) (3) (d) (4) (e)

Which lines that are marked will compile in the following code?

// File name: A.java package packageA; public class A ( protected int

Select the five correct answers.

(a) (1)

(b) (2)

(c) (3)

(d) (4)

(e) (5)

(f) (6)

(g) (7)

(h) (8)

(i) (9)

(j) (10)

(k) (11)

(l) (12)

// File name: A.java package packageA; public class A ( protected int pf; } // File name: B.java package packageB; import packageA. A; public class B extends A { void action (A obj1, B obj2, C obj3) { pf = 10; } } } } obj1.pf obj2.pf = 10; 10; obj 3.pf = 10; class C extends B { void action (A obj1, B obj2, C obj3) { pf = 10; } = obj1.pf obj2.pf obj 3.pf = = = = 10; 10; 10; class D { void action (A obj1, B obj2, C obj3) { pf = 10; obj1.pf obj2.pf obj 3.pf = = // (1) // (2) // (3) // (4) 10; 10; 10; // (5) // (6) // (7) // (8) // (9) // (10) // (11) // (12)

Step by Step Solution

3.36 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a c d e and h The lines 1 3 4 5 and 8 will compile A protected member of a superclass is ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!