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
What does the “final” keyword mean in front of a variable? A method? A class?
Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.
If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?
Which browsers work with java?
Differentiate between == and equals().
What are methods and how are they defined?
What is static block?
How to create com object in Java?
What is a java list?
What is a parameter used for?
Can we restart a thread already started in java?
Can list be null in java?
what is collatration?
What are the changes in java.io in java 8 ?
What is a predicate method?