• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

help with Virtual methods!!

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again friends,
what are virtual methods?? why do we need them? why, they are called Virtual? does that mean they do not exist? how they are invoked? I know that I have to show some effort people, but , it is not clear enough here in my book, I really could not grasp it at all.I can post my book explaination here but, i know it wouldnt help? I appreciate your help and effort.
Ammar salem
 
Ammar Salem
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No Daesung Park , it is in my java book. and i dont know what to do with it
regards,
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A virtual method (or function) is a distinction that doesn't really exist in Java. In C++, a virtual function is a function/method whose dispatch is determined at runtime -- basically, call the method based on the type of the object, not the type of the reference (pointer).

In Java, (instance) method calls are always dispatched at runtime. In other words, all non-static methods are virtual methods.

Henry
 
Ammar Salem
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks to all of you
respect,
Ammar
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With other words, virtual methods are methods that behave polymorphically. See also http://en.wikipedia.org/wiki/Virtual_function
 
Ammar Salem
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you ,Ranchers
 
Ammar Salem
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you,Ranchers
Regards
Ammar
[ January 23, 2008: Message edited by: Ammar Salem ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic