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
Is space a character in java?
Where is core java used?
Define inheritance?
What will be the initial value of an object reference which is defined as an instance variable?
what is mutual exclusion? How can you take care of mutual exclusion using java threads? : Java thread
Are registers volatile?
Will the compiler creates a default constructor if I have a parameterized constructor in the class?
How will you get the platform dependent values like line separator, path separator, etc., ?
What is array in java?
I want to re-reach and use an object once it has been garbage collected. How it's possible?
Which is bigger float or double?
explain the difference between jdk and jvm?
How do you identify independent and dependent variables?
What is the difference between overriding and overloading in OOPS.
How java enabled high performance?