Question: Which statements will cause a compile-time error in the following code? Select the two correct answers. (a) (1) (b) (2) (c) (3) (d) (4) (e)
Which statements will cause a compile-time error in the following code?
![public class MyClass { public static void main(String[] args) { MyClass a;](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/9/4/4/90665bde98a7c00b1706944906184.jpg)
Select the two correct answers.
(a) (1)
(b) (2)
(c) (3)
(d) (4)
(e) (5)
(f) (6)
public class MyClass { public static void main(String[] args) { MyClass a; MySubclass b; } a = new MyClass (); b = new MySubclass (); a = b; a; o P b new MySubclass (); b = new MyClass(); } |||| class MySubclass extends MyClass {} // (1) // (2) // (3) // (4) // (5) // (6)
Step by Step Solution
3.41 Rating (151 Votes )
There are 3 Steps involved in it
d and f 4 and 6 will cause a compiletime error since an attempt is made to assign a r... View full answer
Get step-by-step solutions from verified subject matter experts
