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 the constructor?
If two threads have same priority which thread will be executed first ?
When arithmeticexception is thrown?
What is adapter in java?
What does it mean to flush a file?
Write java program to reverse string without using api?
Explain about arraylist?
Why should we use singleton pattern instead of static class?
2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?
How are variables stored?
What is used of static keyword in java?
What is replaceall in java?
What do you mean by Hash Map and Hash Table?
Is an object null?
Why char array is favored over string for the storage of passwords?