Question: What will be the result of compiling the following program? Select the one correct answer. (a) A compile-time error will occur at (1). (b) A
What will be the result of compiling the following program?

Select the one correct answer.
(a) A compile-time error will occur at (1).
(b) A compile-time error will occur at (2).
(c) A compile-time error will occur at (3).
(d) The program will compile without errors.
public class MyClass { long var; public void MyClass (long param) { var = param; } public static void main (String [] args) { MyClass a, b; } } a = new MyClass (); b new MyClass (5);
Step by Step Solution
3.52 Rating (152 Votes )
There are 3 Steps involved in it
c A compiletime error will occur at 3 since the class does not have a constructor accep... View full answer
Get step-by-step solutions from verified subject matter experts
