Can i have abstract class with no abstract methods?
Answer Posted / priyank
Yes we can have an abstract class without abstract method
in c#.net.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Abstractdemo
{
abstract class A
{
public void Data()
{
Console.WriteLine("this is data");
}
}
class B : A
{
public void Data1()
{
Console.WriteLine("this is B");
}
}
class Program
{
static void Main(string[] args)
{
B b1 = new B();
b1.Data();
}
}
}
FYI
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How does arrays sort work in java?
What is the use of :: in java?
What is Applet Stub Interface ?
Explain about version control?
Can we have return statement in finally clause? What will happen?
What is initial size of arraylist in java?
What does system.gc() and runtime.gc() methods do?
What does a za z0 9 mean?
What are streams?
Explain about OOPS concepts and fundamentals.
I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
What is a finally block? Is there a case when finally will not execute?
How do you remove an object from an arraylist in java?
Which arithmetic operations can result in the throwing of an arithmeticexception?
What is the purpose of garbage collection in java? When is it used?