class Parent
{
public void display ()
{
System.out.println ("Parent");
}
}
class Child extends Parent
{
public void display ()
{
System.out.println ("Child");
}
}
class Main
{
public static void doDisplay (Parent p)
{
p.display ();
}
public static void main (String[]args)
{
Parent a = new Parent ();
Parent b = new Child ();
Child c = new Child ();
doDisplay (a);
doDisplay (b);
doDisplay (c);
}
}
Interview questions [1]
Question 1
What will be the output of the following program ?
class Parent
{
public void display ()
{
System.out.println ("Parent");
}
}
class Child extends Parent
{
public void display ()
{
System.out.println ("Child");
}
}
class Main
{
public static void doDisplay (Parent p)
{
p.display ();
}
public static void main (String[]args)
{
Parent a = new Parent ();
Parent b = new Child ();
Child c = new Child ();
doDisplay (a);
doDisplay (b);
doDisplay (c);
}
}
I have attended an interview for Probuddy solutions and the process was not good and they just conducted for formality, but they are taking only who got reference. They are not looking skills
Round 1: Basic Java questions will include concepts such as encapsulation, inheritance. Additionally, a program involving arrays was asked. Round 2 consisted of coding exercises and scenario-based questions to assess practical skills.
Interview questions [1]
Question 1
What is encapsulation and how it is used in our programs?