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
How many bits is a boolean?
What is meant by binding in rmi?
List some important characteristics on jre
What is a locale?
What an i/o filter in java programming?
What is a boolean flag in java?
What does substring mean?
What's the access scope of protected access specifier?
Is vector ordered in java?
Can we write multiple catch blocks under single try block?
Can you explain the usages of class.forname()?
What method is used to specify a container's layout in java programming?
How many types of assembly languages are there?
What does system out println () do?
What is anagram number?