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
When is the finalize() called?
Can we declare a class as static?
Explain differences between collection api and stream api?
What is operator overloading. Is it is supported in java?
Can I use % with real numbers?
Can we cast any other type to boolean type with type casting?
How strings are created in java?
What is the use of join method?
What is struts in java?
Difference between static binding and dynamic binding?
Can you tell me range of byte?
When is the finalize() called? What is the purpose of finalization?
How we can run a jar file through command prompt in java?
Add a value x to array from index l to r where 0 <= l <= r <= n-1
Can we sort arraylist in java?