Given the following code:
```
class A {
public void display() {
System.out.print("A");
}
}
class B extends A {
public void display() {
System.out.print("B");
}
}
class C extends B {
public void display() {
System.out.print("C");
}
}
```
What will be the output when the following code is executed?
```
B obj1 = new C();
C obj2 = new C();
A obj3 = new C();
obj1.display();
obj2.display();
obj3.display();
```