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?

public class MyClass { long var; public void MyClass (long param) {

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

1 Expert Approved Answer
Step: 1 Unlock

c A compiletime error will occur at 3 since the class does not have a constructor accep... 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!