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
Explain the OOPS concept in Realtime Scenarion ? Take example as CAR. Please explain indetail ?
What is the difference between comparable and comparator in java.util pkg?
What are the types of interface used in the java collections? : java collections
who will give req's to u?. how they send req's to u? . what design documents contains?. when bugs raised on other developer code how to report to them?.(throgh mail or ........). how to retrive 100 recods from dao layer to presentation layer.using which collection?. what is sequence diagram.?.
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.
What are the different types of ways where you can iterate over a list? : java collections
What is an algorithm in java collection framework? : java collections
What are the uses of the set interfaces in the java collections? : java collections
What is the enumerator of the java collection framework? : java collections
What are the different types of features of the java collections framework? : java collections
What is iterator in the java collections framework? : java collections
In hyderabad, which s/w training center is best for java, other than corejava what r the new tools to learn in java,which tool is best & have current requirement,pls give me information about java to learn ?
How is hashset maintained in memory by java ?
what is mean by hasing and maping in java platform and advantage?
Which interface does java.util.hashtable implement?