Skip to content

Instantly share code, notes, and snippets.

@z-a-ki3
Created April 29, 2015 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save z-a-ki3/c2d6339f63718cd4b441 to your computer and use it in GitHub Desktop.
Save z-a-ki3/c2d6339f63718cd4b441 to your computer and use it in GitHub Desktop.
class A{ }
class B extends A { }
class Test {
public static void main(String[] args) {
B obj1 = new B();
A obj2 = new A();
obj2 = obj1;
System.out.println(obj1.getClass());
System.out.println(obj2.getClass());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment