Sale2.java:1:'.'expected
import Sale;
^
public class Sale
{
private static double sale[];
public Sale()
{sale=new double[12];}
public boolean setSale(int season,double amount)
{
if(season>=1&&season<=4&&amount>0.0)
{
sale[season-1]=amount;
return true;
}
else
return false;
}
private double yearAmount()
{
double total=0.0;
for(int i=0;i<4;i++)
total=total+sale[i];
return total;
}
public String toString()
{
return"年业绩为¥"+yearAmount();
}
}
这个是包
import Sale;
public class Sale2
{
private static Sale sale;
public static void main(String args[])
{
Sale sale=new Sale();
double amount;
for(int i=0;i<4;i++)
{
amount=new Double(args[i]).doubleValue();
sale.setSale(i,amount);
}
System.out.println(sale.toString());
}
}
这个是程序。。。。
哎,,这个程序还没有弄明白呢 实在郁闷啊。。。。。。。。。。。。。。。。。。。。。。。