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 / shreya tanavade
if you dont want to override the abstract method i.e. SampleMethod ,then you must declare the subclass as ABSTRACT..i.e.declare....public declare class AbstractExampleImple ...otherwise it wuld throw compilation error
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the final variable?
What are unchecked exceptions in java?
What is the significance of listiterator?
What is java command?
What is ellipsis in java?
Is 0 a prime number?
Name few java.lang classes introduced with java 8 ?
Explain java code for recursive solution's base case?
Explain why wait(), notify() and notifyall() methods are in object class rather than in the reading class?
What is javac in java?
What is singleton class in java and how can we make a class singleton?
Why are the objects immutable in java?
What is a singleton factory?
What is the difference between I ++ and ++ I in java?
What is variable explain with example?