Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class A {
- public void f(A a) {
- System.out.println("f-A");
- }
- }
- class B extends A {
- public void f(A o) {
- System.out.println("f-B");
- }
- public void g() {
- System.out.println("g");
- }
- }
- public class Main {
- public static void main(String[] args) {
- A a = new B();
- a.f(new B());
- System.out.println(A.class.isInstance(new B()));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement