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
What is the format specifier?
What is int argc char * argv?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.
How to find the largest value from the given array.
What one should take care of, while serializing the object?
How many bytes is 255 characters?
What do you understand by garbage collection in Java? Can it be forced to run?
Why we do exception handling in java and how many types of exceptions are there?
Is java se free?
What is a JAR file?
What are the core java topics?
What does sprintf mean?
What is type inference in java8?
Does java support function overloading, pointers, structures, unions or linked lists?