Search:

Type: Posts; User: prasanna1157

Search: Search took 0.17 seconds.

  1. Replies
    8
    Views
    336

    Re: Inheritance - Object class

    Thank you.
  2. Replies
    5
    Views
    250

    Re: Why does this code compile?

    Thank you.
  3. Replies
    8
    Views
    336

    Re: Inheritance - Object class

    Thank you for persisting with me. I've copied here the text I don't understand.

    "Dynamic method dispatch is the mechanism
    by which a call to an overridden method is resolved at run time, rather...
  4. Replies
    8
    Views
    336

    Re: Inheritance - Object class

    Thank you for the response. This is very helpful. I get the point about the class being generic. I think I didn't word the 2nd part of my previous question properly.

    When we use a reference...
  5. Replies
    8
    Views
    336

    Re: Inheritance - Object class

    ok, thank you. I get the point now, but I am confused as to what exactly happens when we do this (Object o = new Rectangle()). What does the program understand when we say this? And, what advantage...
  6. Replies
    8
    Views
    336

    Inheritance - Object class

    Hello,

    The following code doesn't compile because it says "method area()" not found when called with the object reference "o". If every class in Java is a subclass of the Object class, why is this...
  7. Replies
    5
    Views
    250

    Re: Why does this code compile?

    How does the program distinguish which method to call? Since both methods take 1 int, I could be calling either of them (because varargs can take no arguments also).
  8. Replies
    5
    Views
    250

    Why does this code compile?

    Hello,

    Can someone please tell me why this code compiles? I thought it must give an error because of an ambiguous call to varargs(), but it prints "Hello1" when varargs(1 ) is called.


    package...
Results 1 to 8 of 8