Solved

C# virtual method equivalent in java

Posted on 2007-04-09
4
588 Views
Last Modified: 2012-06-27
Hi,
    What is the VIrtual method equivalent in java?

Thanks
0
Comment
Question by:jdharsha
4 Comments
 
LVL 3

Accepted Solution

by:
ieciep earned 30 total points
ID: 18880399
0
 

Author Comment

by:jdharsha
ID: 18880435
Thanks!! but can you send me any link that says Virtual method in c# is equivalent to abstract in java.b'cos I came across following:

What is the difference between virtual and abstract?

These two keywords are sometimes confused because both can be over-ridden. However, unlike Virtual members, Abstract members have no implementation.
0
 
LVL 25

Expert Comment

by:clockwatcher
ID: 18880526
All methods in java are virtual.

http://www.smotricz.com/kabutz/Issue021.html
0
 
LVL 9

Assisted Solution

by:ripahoratiu
ripahoratiu earned 20 total points
ID: 18897841
Well in very siple words:
Abstract methods are "pure virtual", they don't have a body and MUST be implemented (overrided) by the childs in order for them to be instantiable, orelse they are abstract classes too.
Virtual methods CAN be overrided, they provide an implementation but can be modified by the derived classes (through override).
Therefore an abstract method IS a virtual method and obviously the reverse is not true.

And yes, in Java all the methods are virtual (can be overriden in derived classes), so you won't find out a word for it.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question