interface vehicle
 {public double getWeight();
  public int getWheels();
   public String getName();
}
_________________________________________
class vehicleobject implements vehicle
 {private double weight;
  private int wheels;
  private String na;

     public vehicleobject(String n,int w, double weight)
       {na = n;
        this.weight = weight;
        wheels = w;
	}

     public double getWeight()
      {return weight;
       }

    public int getWheels()
     {return wheels;
      }

  public String getName()
   {return na;
    }
    }
    ____________________________________
    class car extends vehicleobject
	 {
	  public car()
	   {super("car",4,5000);
	   }
  }
  _________________________________
  class plane extends vehicleobject
   {
    public plane()
     {super("plane",3,10000);
     }
  }
  _________________________________________

import java.io.*;
import java.util.*;

public class test

{public static input in = new input();

public static void main(String[] args) throws IOException
 {
 vehicle c = new car();
 System.out.println(c.getName() + " Weight "+c.getWeight()+" Wheels "+c.getWheels());
 vehicle p = new plane();
  System.out.println(p.getName() + " Weight "+p.getWeight()+" Wheels "+p.getWheels());
}
}  // note : c can be of vehicle, vehicletype or car