MCQs > IT & Programming > Java > What would happen on trying to compile and run the following code? class House { public final void MaintainMethod() { System.out.println('MaintainMethod'); } } public class Building extends House { public static void main(String argv[]) { House h = new House(); h.MaintainMethod(); } }

Java MCQs

What would happen on trying to compile and run the following code?

class House
{
public final void MaintainMethod()
{
System.out.println("MaintainMethod");
}
}
public class Building extends House
{
public static void main(String argv[])
{
House h = new House();
h.MaintainMethod();
}
}

Answer

Correct Answer: Successful compilation and output of "MaintainMethod" at run time

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it