fork download
  1. class Car
  2. {
  3. private String type=null;
  4. public Car()
  5. {
  6. this.type="Maruti";
  7. }
  8. public Car(String type)
  9. {
  10. this.type=type;
  11. }
  12. public static void main(String arg[])
  13. {
  14. Car car=new Car();
  15. car=new Car("Honda");
  16. System.out.print(car.type);
  17. }
  18. }
  19.  
Success #stdin #stdout 0.08s 52620KB
stdin
Standard input is empty
stdout
Honda