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


Please Help Members By Posting Answers For Below Questions

What is command line used for?

587


What is an example of a boolean?

569


What is boolean logic?

559


Which is bigger float or double?

514


What is executor memory?

520






What are nested classes in java?

600


Why vector class is used?

538


Explain differences between collection api and stream api?

610


What is the difference between abstract classes and interfaces?

511


What does a method signature consist of?

508


What is math in java?

562


can rmi and corba based applications interact ?

667


What is a constructor, constructor overloading in java?

527


How would overload a function based on return type?

546


What is the difference between serial and throughput garbage collector?

579