Solved

C# virtual method equivalent in java

Posted on 2007-04-09
4
584 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 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