class Vehicle
String cname,clr;
void accept(String
cn,String c)
{
cname=cn;
clr=c;
}
void display()
{
[Link]("The name of
Company is"+cname);
[Link]("The color of
vehicle is"+clr);
}
class TwoWheeler extends
Vehicle
{
String bname;
long cost;
void get(String b,long
c)
{
bname=b;
cost=c;
}
void put()
{
[Link]("The name of Bike
is"+bname);
[Link]("The Cost of bike
is"+cost);
}
class ThreeWheeler extends
Vehicle
{
String tname;
long cost;
void input(String
tn,long c)
{
tname=tn;
cost=c;
}
void output()
{
[Link]("The name of three
wheeler is"+tname);
[Link]("The cost of three
wheeler is"+cost);
}
class FourWheeler extends
Vehicle
{
String fname;
long price;
void getdata(String
fn,long p)
{
fname=fn;
price=p;
}
void putdata()
{
[Link]("The name of four
wheeler is"+fname);
[Link]("The Price of four
wheeler is"+price);
}
}
class Tree
{
public static void
main(String[] args)
{
Vehicle v=new
Vehicle();
TwoWheeler
tw=new TwoWheeler();
ThreeWheeler
th=new ThreeWheeler();
FourWheeler
fw=new FourWheeler();
[Link]("Honda","White");
[Link]();
[Link]("Activa
125",98000);
[Link]();
[Link]("Bajaj","Yellow");
[Link]();
[Link]("Auto",230000);
[Link]();
[Link]("Toyota","Black");
[Link]();
[Link]("Fortuner",3500000);
[Link]();
}
}