
Practice Constructors and Destructors –
What will be the output of the program?
class A {
public A(int x){ }
}
class B extends A { }
public class test {
public static void main (String args []) {
A a = new B();
System.out.println("complete");
}
}

Practice Constructors and Destructors –
What will be the output of following program?
#include
using namespace std;
class Point
{
int x, y;
public:
Point(const Point &p) { x = p.x; y = p.y; }
int getX() { return x; }
int getY() { return y; }
};
int main()
{
Point p1;
Point p2 = p1;
cout << "x = " << p2.getX() << " y = " << p2.getY();
return 0;
}