找不到符号错误..?

时间:2015-02-12 02:10:12

标签: java

import java.util.ArrayList;
import javax.swing.JOptionPane;


public class CustomerTest
{

  public static void main(String args[])
    {
        String message = "";
        ArrayList<Customer> cList;

        ArrayList<Customer> customerList = new ArrayList<>();

        Customer c1 = new Customer ("Jones", new Address("Cooper","Arlington", "Texas", 76019), 12345);
        Customer c2 = new Customer ("Smith", new Address("Bowen","Arlington", "Texas", 76006), 65489);
        Customer c3 = new Customer ("willis", new Address("Bowen","Arlington", "Texas",75550), 27589);

                c1.setCType(Customer.CustomerType.STUDENT);
                c2.setCType(Customer.CustomerType.FACULTY);
                c3.setCType(Customer.CustomerType.GOVERNMENT);




        customerList.add(c1);
        customerList.add(c2);
                customerList.add(c3);


                Course co1 = new Course ("Java 1","Davis", 125.00, new Date(1,1,2015), new Date(1,15,2015));
                Course co2 = new Course ("Java 2","Jones", 125.00, new Date(1,1,2015), new Date(1,15,2015));
        Course co3 = new Course ("InClassCourse","PHOTOGRAPHY", 75.00, new Date(2,5,2015), new Date(3,2,2015));


         for (Customer c: customerList)
         {

          {
            message += c.creatInvoice() + "\n" + c.createInvoice();
          }
         }
            JOptionPane.showMessageDialog(null, message);
    } 
}

我在

message += c.creatInvoice() + "\n" + c.createInvoice();

我一直在研究这个问题几个小时,无法弄清楚它想要什么。我需要在课堂上宣布吗?任何帮助,将不胜感激。

1 个答案:

答案 0 :(得分:0)

你在回顾中提出错误。

`creatInvoice()`

应该是

`createInvoice()`

您收到symbol not found因为编译器不知道creatInvoice是什么。