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

Is java a digit method?

508


What is the purpose of format function?

618


what is the constructor and how many types of constructors are used in java?

531


What is foreach loop in java?

528


What Is Composition?

575






What is style and indentation?

546


Why for each loop is used?

498


What do you understand by soft reference?

582


Can we sort hashset in java?

620


How to use arraylist in java netbeans?

502


Can we catch more than one exception in a single catch block?

621


What is the basic of java?

566


What is the difference between a static and a non-static inner class in java programming?

521


What is the purpose class.forname method?

552


How to Sort Strings which are given in List and display in ascending order without using java api.

3754