What is the use of normal method(not static or abstract) in abstract class

Posted by Vikash under C# on 8/11/2012 | Points: 10 | Views : 830 | Status : [Member] | Replies : 3
My question is that if we can't create the object of an abstract class then how we can use non-static & non-abstract method either in class or out of the class.
As we are able to define normal the method

public class Check
{
// sonu s = new sonu();eror
public Check()
{

}
}
public abstract class sonu
{
public sonu()
{
}
public void check()//in my sense there is no use of this function.....
{

}
public static void checking()//this is usefull.....
{

}
}

Regards,
Vikash Pathak



Responses

Posted by: Gopesh9 on: 8/13/2012 [Member] Starter | Points: 25

Up
0
Down
No there is no use of the normal function in abstract class since you cannot instantiate the abstract class, so you cant use that function anywhere.

G. S.
.Net Developer

Vikash, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vikash on: 8/13/2012 [Member] Starter | Points: 25

Up
0
Down
if we cant use normal function then why there is facility to define normal funcion in abstract class ?

Regards,
Vikash Pathak

Vikash, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gopesh9 on: 8/13/2012 [Member] Starter | Points: 25

Up
0
Down
There is a facility to define normal function in abstract class if you want any function to be private, you need not to write the private keyword explicitly, these methods will be automatically be private since you cannot use them in your application.

G. S.
.Net Developer

Vikash, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response