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

Which of the following statements are incorrect? a) Default constructor is calle

ID: 2844823 • Letter: W

Question

Which of the following statements are incorrect?

a) Default constructor is called at the time of declaration of the object if a constructor has not been defined.

b) Constructor can be parameterized.

c) finalize() method is called when a object goes out of scope and is no longer needed.

d) finalize() method must be declared protected.6. What is the output of this program?

class overload {

int x;

int y;

int add(int a) {

x = a + 1;

}

int add(int a , int b){

x = a + 2;

}

}

class Overload_methods {

public static void main(String args[])

{

overload obj = new overload();

int a = 0;

obj.add(6);

System.out.println(obj.x);

}

}

a) 5

b) 6

c) 7

d) 8

Explanation / Answer

c)7

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