Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
How do you invoke a method in a abstract class without inheriting the class?
Posted 6-Dec-12 20:04pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
AnkitGoel.com at 7-Dec-12 13:16pm
   
it would be good if u explain here rather than posting a link and letting others waste their time reading a long article.
Dave Kreskowiak at 13-Jan-14 19:10pm
   
Actually, his answer is just fine.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

We can only invoke static methods of an abstract class without sub classing it.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

You can invoke it by using static modifier for your method
 
ex:
abstract A
{
public void G()
{
// code
}
 
}
 
then you can call it like so :
A.G();
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 245
1 OriginalGriff 215
2 Manfred R. Bihy 190
3 CHill60 180
4 _Amy 155
0 OriginalGriff 7,395
1 Sergey Alexandrovich Kryukov 6,163
2 Maciej Los 3,754
3 Peter Leow 3,448
4 CHill60 2,702


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 13 Jan 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100