When we will use an Interface and Abstract class?

Answer Posted / ravikiran

interface is used when we want all the methods implement
the methods differnetly in different situations.

where as an abstract classis used to define abstarct as
well as non abstract methods

Is This Answer Correct ?    15 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a custom exception?

574


How to create an interface?

626


What are static blocks and static initalizers in java ?

587


How is garbage collection controlled?

736


What are three advantages of using functions?

538






What is object of class in java?

598


Can we override constructors?

544


What is difference between Heap and Stack Memory?

536


What is arrays sort in java?

576


Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?

7421


What is the java reflection api? Why it’s so important to have?

557


Can we sort arraylist in java?

565


What is sizeof () operator?

573


What is an error in java?

641


What is constructor and its types?

541