Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

how do i create the classes XX and YY?

Thu Oct 13, 2011 3:59 pm

Code:
public class ZZ {
     public static void main (String args[]){

   String message;
  double x1,x2=0.4;
     xx   test= new xx("Johnny",50);
       test.setTarget(80.90);
          test.setX(10);
  yy  y1= new yy("zzzz");
       yy y2= new yy("yyyy",70.5);
y1.setY(200); //litres
y1.driveMe("Today");
y2.setY(20); //litres
y1.setMax(200); //km/hour
      y2.setA( 0.98);
          y2.accellerate( 11.2);
           System.out.println(y2.getModel() +" costs " +y2.getPrice( x2));
     
         test.tt(y1);
         test.tt(y2);
        System.out.println(y1.getModel() +" has  " +y1.getY() + " litres  remaining");   //litres
        System.out.println(test.getID() +" has  travelled " + test.getLog() );  //km
}
}




Post a reply
  Related Posts  to : how do i create the classes XX and YY?
 How to create and use classes in C++     -  
 about classes     -  
 Abstract Classes in jsp     -  
 instantiating java classes     -  
 inherited in the derived classes     -  
 Wrapper classes use in java     -  
 java wrapper classes     -  
 Add and Remove CSS classes to html tag dynamically     -  
 Nested classes(inner class) in java     -  
 Boxing and unboxing make using wrapper classes     -