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 hibernate ceteria ?

4 Answers   Fidelity,


Explain JSP life cycle?

2 Answers   Accenture,


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

0 Answers  


Should we create system software ( e.g operating system ) in java ?

0 Answers  


what is the diffrence between insurance and telecom domain?

1 Answers  






How to call the m1() method of Base class in below snippet ? class Base { public void m1() { System.out.println("Base m1 "); } public void m2() { System.out.println("Base m1 "); } } ====================== class Derived extends Base { public void m1() { System.out.println("Derived m1"); } public void m3() { System.out.println("Derived m3"); } public static void main(String[] args) { Base ob=new Derived(); ob.m1(); //System.out.println("Hello World!"+ob.m1()); } }

6 Answers   Cap Gemini, TCS,


waht are architecture of web application?

2 Answers  


What is the Spring2.5 MVC Navigation flow?

1 Answers   IBM,


How many controlers are there in spring? Plz send me ans

1 Answers   HCL,


what debugging tool that can be used to debug the java programs?

1 Answers   Inforica,


can u draw class/object diagram for ATM

0 Answers   HCL, Zycus Infotech,


VSS Objectives

1 Answers  


Categories