Topic: 求助 import sale错误

  Print this page

1.求助 import sale错误 Copy to clipboard
Posted by: ceozh
Posted on: 2005-05-17 15:48

我编写了sale.class类
在sale2中引用sale,sale2.java如下
import Sale;
public class Sale2
{
private static Sale sale;
public static void main (String args[])
{
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());
}
}
提示sale2.java:1:'.'expected import sale 1 error不知是何原因,请指教

2.Re:求助 import sale错误 [Re: ceozh] Copy to clipboard
Posted by: wind520sand
Posted on: 2005-05-17 18:21

import Sale;
我看到这句怪怪的,把他杀掉,只要你的两个类放在同一个目录,java会自己找的,不用你指示的。
你用pack包住我觉的还差不多!
以上不对的请大家指示!!!:)呵呵

3.Re:求助 import sale错误 [Re: ceozh] Copy to clipboard
Posted by: wanghang110119
Posted on: 2005-05-18 16:58

Sale是个类,怎么能写import Sale 呢!
应该是import +包+类


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923