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


Please Help Members By Posting Answers For Below Questions

What are peerless components in java programming?

577


Difference between current previous versions of Java?

551


Why isn’t there operator overloading?

587


What is boolean example?

523


What are keywords and reserved words in java?

550






What is comparator in java?

547


What are the fileinputstream and fileoutputstream?

565


Why super is first line in java?

550


Can we overload the main() method?

545


What is vector capacity in java?

593


Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.

1602


What are the states of thread in java?

508


What do you mean by buffering?

548


Explain the difference between the public, private, final, protected, and default modifiers?

549


What is floating data type?

534