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 difference between string and stringbuffer?

496


Explain about core java?

628


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

560


What's the purpose of using break in each case of switch statement?

514


What is factor r?

527






Does java arraylist maintain insertion order?

551


Does chrome use java?

521


What are Normalization Rules? Define Normalization?

551


Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).

2241


What is another word for methodology?

521


What is the method overriding?

621


Explain the available thread states in a high-level?

530


What does java ide mean?

642


What do you mean by JVM?

591


When do I need to use reflection feature in java?

627