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
What are maps interfaces in the java collections? : java collections
Hi frnds how to lock an user when he enter wrong credentials more than 3 time using java or j2ee tech take username and password in a bean no need to connect DB and validate give me some sample application code or links its urgent for me thanks in advance
What are the types of java collections? : java collections
What is the use of the list interface in the java collection? : java collections
Hi Friends , am newbie to ajax. For example just consider one account registration - A form contains 8 text fields with submit button. In this form second texbox contains "username " . On right side of text box there is a label box . On clilck action i need to determine user is available or not. Is it possible on clicking label or should i click submit button.
Explain the OOPS concept in Realtime Scenarion ? Take example as CAR. Please explain indetail ?
What is the enumerator of the java collection framework? : java collections
What are the different types of ways where you can iterate over a list? : java collections
What are the differences between the java collection and the java list? : java collections
What do you understand by synchronization? Why is it important?
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 ?
What is an algorithm in java collection framework? : java collections
can u draw class/object diagram for ATM
How do I find jre path in windows?
What are the different types of collections views being provided by the map interface? : java collections