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
my interviewer asked me what technical specification you used how to answer that question
Which server-side script takes the input from JavaScript, can access the database if it needs to, and processes the data.
What are the interfaces in java collections? : java collections
What are the types of java collections? : java collections
Hi Friends, i have searched in google but not clear. can you give bank example with synchronized keyword
What are the types of interface used in the java collections? : java collections
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
What is the use of hashcode in java ?
What are the types of the main implementing classes in the map interfaces? : java collections
What are the different types of ways where you can iterate over a list? : java collections
How do I find jre path in windows?
How is hashset maintained in memory by java ?
What is the difference between comparable and comparator in java.util pkg?
what is mean by hasing and maping in java platform and advantage?
What are the different types of features of the java collections framework? : java collections