Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Why the answer is c ? can anyone tell me why ? thanks public class Player extend

ID: 653633 • Letter: W

Question

Why the answer is c ?

can anyone tell me why ? thanks

public class Player extends Point { private String myName; public Player( Point p. String name ) { super( p ); myName = name; } public String getName(){ return myName; } } public class HuckleBuckle { public static void main( String[] args ) { Point p = new Point( 0, 0 ); Player s = new Player( p, "Sue" ); Point xl = s; Player x2 = p; System.out.println( s.myName ); System.out.println( ((Player) x1).getName() ); } Which of the following is TRUE about line 6 of Hucklebuckle? This statement will compile, and will not throw an exception or run-time error if it is executed. This statement will compile, and will throw an exception or run-time error if it is executed. This statement will not compile. Write your answer (a, b, or c) in the following box.

Explanation / Answer

There is an object 's' of player class and there is a statement given Point x1 = s.

Hence, the line 8 will compile and give output as 'Sue'.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote