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
Is java a digit method?
What is the purpose of format function?
what is the constructor and how many types of constructors are used in java?
What is foreach loop in java?
What Is Composition?
What is style and indentation?
Why for each loop is used?
What do you understand by soft reference?
Can we sort hashset in java?
How to use arraylist in java netbeans?
Can we catch more than one exception in a single catch block?
What is the basic of java?
What is the difference between a static and a non-static inner class in java programming?
What is the purpose class.forname method?
How to Sort Strings which are given in List and display in ascending order without using java api.