Question: What is the output of the following code snippet? ( if there is any kind of error indicate this in your answer with the word

What is the output of the following code snippet? (if there is any kind of error indicate this in your answer with the word "error")
public class Chapter6Problems
{
public static void main(String[] args)
{
new ChildClass(4);
}
}
class ParentClass
{
public static int a=2;
public ParentClass(int i)
{
a+=2;
System.out.print(a+i); //notice the ln is missing
}
}
class ChildClass extends ParentClass
{
public ChildClass(int i)
{
System.out.print(i); //notice the ln is missing
}
public ChildClass()
{
this(12);
System.out.print(3); //notice the ln is missing
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!