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 command line used for?
What is an example of a boolean?
What is boolean logic?
Which is bigger float or double?
What is executor memory?
What are nested classes in java?
Why vector class is used?
Explain differences between collection api and stream api?
What is the difference between abstract classes and interfaces?
What does a method signature consist of?
What is math in java?
can rmi and corba based applications interact ?
What is a constructor, constructor overloading in java?
How would overload a function based on return type?
What is the difference between serial and throughput garbage collector?