SHARE
TWEET

Untitled

a guest Oct 16th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. public class TestCar {
  3.    
  4.     public static void main( String[] args) {
  5.        
  6.         System.out.println( "Class Basics");
  7.         // create Car objec
  8.         int i = 10;
  9.         Car carObj1 = new Car();
  10.         Car carObj2 = new Car("BMW100");    
  11.         System.out.println ( carObj1);
  12.         //carObj2.setRegNum("2000");
  13.         System.out.println ( carObj2);
  14.        
  15.         Person p1 = new Person ( "Alice" , 25);
  16.         p1.buyCar(carObj2);
  17.         System.out.println ( p1);
  18.        
  19.     }
  20.    
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top