Test your overloading n overriding concept

public class TestOverLoadnOverride {

public static void main(String[] args) {
A c1 = new C();
C c2 = new C();
c1.m1(c2);
}

}

class A {

void m1(A a) {
System.out.print("A");
}
}

class B extends A {
void m1(B b) {
System.out.print("B");
}
}

class C extends B {
void m1(C c) {
System.out.print("C");
}
}

29 thoughts on “Test your overloading n overriding concept

  1. Its like you read my mind! You appear to know a lot about this, like you
    wrote the book in it or something. I think that you can do with a few pics to
    drive the message home a bit, but other than that, this is great blog.

    An excellent read. I’ll certainly be back.

    Like

  2. hey there and thank you for your info –
    I have certainly picked up anything new from right here. I
    did however expertise several technical points using this web site,
    as I experienced to reload the web site a lot of times previous
    to I could get it to load correctly. I had been wondering
    if your web hosting is OK? Not that I am complaining, but sluggish loading instances times
    will often affect your placement in google and could damage your quality score if ads and marketing with Adwords.
    Well I am adding this RSS to my email and could look out for a lot more of your respective
    interesting content. Make sure you update this again soon.

    Like

  3. I’m really inspired along with your writing abilities as
    smartly as with the structure on your blog. Is that this a paid subject matter or
    did you modify it your self? Either way keep up the excellent high quality writing,
    it’s rare to look a nice blog like this one nowadays..

    Like

  4. Have you ever considered about adding a little bit more than just your
    articles? I mean, what you say is valuable and everything.
    Nevertheless think of if you added some great
    photos or videos to give your posts more, “pop”! Your content is excellent but with pics and video clips,
    this website could certainly be one of the very best
    in its field. Fantastic blog!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s