*** The error appears in : public void PrintValues() << It says : class or interface is expected ??
what does that means ? How can I fix this error ???
This is my program :
class Vehicle
{
private int VehicleNo;
private char ModelYear;
private char ModelName;
private int BasicPrice;
private int Tax;
public void GetValues( int V,char M,char Mo,int B,int T)
{
VehicleNo = V;
ModelYear = M;
ModelName = Mo;
BasicPrice = B;
Tax = T;
}
public int CalculatePrice()
{
Netprice=BasicPrice + Tax;
}
}
public void PrintValues()
{
System.out.println("The Vehicle number is "+VehicleNo);
System.out.println("The Model year is "+ ModelYear);
System.out.println("The Model name is "+ ModelName);
System.out.println("The Basic price is "+ BasicPrice);
System.out.println("The Tax is "+ Tax);
System.out.println("The Netprice is "+ Netprice);
}
class Question1
{
public static void main(String args[])
{
Vehicle e=new Vehicle();
Vehicle e1=new Vehicle();
e.getValues(34561,"2006","Toyota",15.000,120);
e1.getValues(92634,"2007","BMW",75.000,90);
e.CalculatePrice();
e1.CalculatePrice();
e.PrintValues();
e1.PrintValues();
}
}
