Interviews4 answers
This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }
4 Answers
abstract methods cannot declare a body, abstract method cannot have virtual, the return type is missing in C method.
Renuga PalanichamyPosted Jan 24, 2017, 11:45 AM EST
Abstract class can create abstract and non abstract method but we can not create virtual method in abstract class. So declare class is not correct.
Bhuvan PandeyPosted Aug 5, 2016, 4:24 AM EDT
Abstract Method does not have body
Mangesh KulkarniPosted Jul 31, 2016, 11:02 AM EDT
Ans: Method without implementation is called abstract method. It is declared with abstract key word. Please see inline comment.
abstract class A
{
public abstract void Disp();//correct
public abstract void B() //wrong
{
}
public absract virtual C() //wrong
{
}
}
Rajesh SinghPosted Nov 16, 2015, 5:51 AM EST


