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


Please Help Members By Posting Answers For Below Questions

What is an algorithm in java collection framework? : java collections

584


Which interface does java.util.hashtable implement?

679


How do I find jre path in windows?

532


my interviewer asked me what technical specification you used how to answer that question

1935


can u draw class/object diagram for ATM

5534






Hi Friends, i have searched in google but not clear. can you give bank example with synchronized keyword

1616


How is hashset maintained in memory by java ?

596


HOW MUCH PERCENTAGE WE DEDUCT FOR OUR SUPPLIERS OR OTHER PROFESSIONALS

1583


What is the Spring2.5 MVC Navigation flow?

5378


What is the enumerator of the java collection framework? : java collections

568


What are the different types of classes implemented in the set interfaces? : java collections

611


What do you understand by synchronization? Why is it important?

577


What are the classes in the java collection framework? : java collections

599


What is the difference between comparable and comparator in java.util pkg?

595


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.

1593