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

What is need of DAO? Write one simple DAO example?

2 Answers   IBM,


What are the differences between the java collection and the java list? : java collections

0 Answers  


What are the types of interface used in the java collections? : java collections

0 Answers  


What is the use of hashcode in java ?

0 Answers  


VSS Objectives

1 Answers  


What is the Spring2.5 MVC Navigation flow?

1 Answers   IBM,


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

0 Answers  


Hi we have an urgent requirement for Java/J2ee technical lead position & also looking for "Java Guidewire claimcentre" experienced professional for Bangalore location if interested can reach srisanh@gmail.com

0 Answers  


What is deque in the java collections framework? : java collections

0 Answers  


What are maps interfaces in the java collections? : java collections

0 Answers  


what is diff string and stringbuffer

7 Answers   CTS, HCL,


What are the types of java collections? : java collections

0 Answers  


Categories