I Have a class abstract with one abstract method, so that
method should override in the subclass, but i dont want to
override, if i am not override what will happen? If
compilation will occur then i dont want to give compilation
error, then what we need to do???
See the sample program.
public abstract class AbstractExample {
public abstract void sampleMethod();
}
public class AbstractExampleImple extends AbstractExample {
}
Answer Posted / kvsravindrareddy
Normally abstract method should implement in the subclass,
otherwise application will give compilation error. If you want
to without compilation error, then subclass also make as a
abstract class, application will not give any compilation
error.
See the below sample code.
public abstract class AbstractExample {
public abstract void sampleMethod();
}
public abstract class AbstractExampleImple extends
AbstractExample {
}
| Is This Answer Correct ? | 20 Yes | 0 No |
Post New Answer View All Answers
What are triggers in DB? Explain their types. How do they work?
What is the use of singleton?
What is javac in java?
What is a class component?
What is are packages?
What is Session reduplication and how its done?
What checkbox method allows you to tell if a checkbox is checked?
Why do we create public static method in java?
What is the properties class?
What are the properties of thread?
What is the difference between hashmap and hashtable in java?
What are loops in java?
Wha is the output from system.out.println(“hello”+null); ?
How hashmap increases its size in java?
What is the set interface in java programming?