IN java collections we have both interfaces and classes.
instead of using interfaces why we can't use classes only
like that why we can't use interfaces only. why we need two
things interface and class.
Answer Posted / sarath
Both of them have different purpose.
A Class have state(Fields) and behaviour(Methods). But in Interface we are telling a common behaviour.
for example I have a class called ABCBycycle.java . It implements some common behaviour of bycyle from Bycycle interface,
by implementing the Bycycle interface we are telling that ABCBycycle.java have some common behaviour of bycyle.
So iterface not the blue print of state and behaviour.
But Class is the blue print of some state and behaviour
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
how we can use debug in myeclipse 6.0 in order solve the problems that exist in our program when there are 900 to 1000 pages in a web application
Similarity and difference between static block and static method ?
Does a class inherit the constructors of its superclass in java programming?
Explain about anonymous inner classes in java?
What is t in generics in java?
What is codebase?
Why java applets are more useful for intranets as compared to internet?
Differentiate between vector and array list.
Why object class is super class for every class in java?
What is meant by null and void?
What are loops in java? What are three types of loops?
What is static block?
What is the purpose of the strictfp keyword?
Is there any case when finally will not be executed?
EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.