• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

inheritance is funny

 
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

why does this happen ?
:-/
------------------
KS
 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!
The code executes with the output derived. I think due latebinding the method call(null) executes mathod taking parameter of the subclass.Correct me if i am wrong.
 
Kalpesh Soni
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shabbir zakir:
hi!
The code executes with the output derived. I think due latebinding the method call(null) executes mathod taking parameter of the subclass.Correct me if i am wrong.


late binding, without an object, in static method ??
------------------
KS
 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this question was anwered before in this forum if u want a detailed explanation search for that
The reason for this is java goes for more specific method
now try using two classes which are not related then u will get a compile time error bcoz java cant resolve this
Cherry
 
Kalpesh Soni
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks cherry
but how will i find it
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kalpesh,
Select the 'search' function at the top of the page, enter relevant keywords, for example: derived base class; then click 'Perform Search'.
You'll get a list of all the previous posts containing the same words; you can then browse through them.
------------------
Jane Griscti
Sun Certified Java 2 Programmer
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic