2. Write a interface "Car" with the following methods
void setName(String)
String getName()
void setColor(String)
String getColor()
void setModel(long)
long getModel()



2. Write a interface "Car" with the following methods void setName(String) Str..

Answer / 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

More Java J2EE AllOther Interview Questions

how to deploy the web application ?

2 Answers   Accent,


what is difference between web server and application server?

1 Answers   L&T,


Is it Mandatory to map each pojo class variable with table column in Hibernate? Is there any alternative to skip some of those? Thanks in advance...

2 Answers   Span Systems,


What are the types of the main implementing classes in the map interfaces? : java collections

0 Answers  


what is the difference between checked and unchecked Exceptions?

4 Answers   CTS,






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.

0 Answers  


HOW MUCH PERCENTAGE WE DEDUCT FOR OUR SUPPLIERS OR OTHER PROFESSIONALS

0 Answers  


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

0 Answers  


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

0 Answers  


what is the IDE that you have used to write your java programs?

2 Answers   Inforica, Interface Software,


What are the different types of ways where you can iterate over a list? : java collections

0 Answers  


what is the diffrence between insurance and telecom domain?

1 Answers  


Categories