2. Write a interface "Car" with the following methods
void setName(String)
String getName()
void setColor(String)
String getColor()
void setModel(long)
long getModel()
Answer Posted / suresh sa
interface car{
void setName(String s);
String getName();
void setColor(String color);
String getColor();
void setModel(long model);
long getModel();
}
I Think u r trying to create getter and setter fields for
the above parameters better go for POJO, rather than going
for interface
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How do I find jre path in windows?
What is the enumerator of the java collection framework? : java collections
can u draw class/object diagram for ATM
What is iterator in the java collections framework? : java collections
What are the queues in the java collection framework? : java collections
What are the uses of the set interfaces in the java collections? : java collections
Which java collection class can be used to maintain the entries in the order in which they were last accessed?
Which sorting algorithm is used by collections.sort() in java ?
please mail me the interview question based on java/j2ee
What are the different types of classes implemented in the set interfaces? : java collections
What are the interfaces in java collections? : java collections
What is the use of the list interface in the java collection? : java collections
Should we create system software ( e.g operating system ) in java ?
What are the types of interface used in the java collections? : java collections
What do you understand by synchronization? Why is it important?