Can i have abstract class with no abstract methods?
Answer Posted / punit
Yes we can, try this example:
abstract class absDemo
{
void hello()
{
System.out.println("Hello abstract");
}
}
class ab extends absDemo
{
void hello1()
{
System.out.println("hello hello1");
}
}
class absDemo1
{
public static void main(String args[])
{
ab a=new ab();
a.hello1();
a.hello();
}
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Break statement can be used as labels in java?
Can we use a switch statement with strings?
What is a parameter in matrices?
How objects of a class are created if no constructor is defined in the class?
What differences exist between iterator and listiterator?
What is operator overloading. Is it is supported in java?
Why generics are used in java?
Write a program to check string is palindrome without using loop?
Are global variables initialized to zero?
Is java a digit method?
What is data object example?
What are different type of exceptions in java?
Can a class be declared as static?
can used Protected Class outside Function.?
How does queue work in java?