gpt4 book ai didi

java - 通过方法传递的变量的 "Cannot find symbol"

转载 作者:行者123 更新时间:2023-12-01 17:23:38 25 4
gpt4 key购买 nike

Screenshot showing error

为什么在引用通过构造函数传递的变量时会出现错误?

这是完整的 Customer.java 类:

import java.sql.ResultSet;
import javax.servlet.http.HttpServletRequest;

public class Customer {

// SQL Variables
private final String URL = "jdbc:mysql://localhost/books";
private final String USER = "root";
private final String PASSWORD = "P@ssw0rd1";

// Class Variables
int CustomerID;
String customerEmail;
String customerPassword;
String customerFirstName;
String customerLastName;
String customerAddress;
String customerCity;
String customerProvince;
String customerPostalCode;
String customerPhoneNumber;
String customerCreditCardNumber;
String customerExpiryDate;
String customerCreditCardType;

// Class Constructors
public Customer(int customerID) // Constructor for an Existing Customer
{
ResultSet customerData = MySQLQuery("select * from Customers where CustomerID=" . customerID);
}
public Customer(HttpServletRequest post) // Constructor for a new customer
{

}
// Constructor Methods
public ResultSet MySQLQuery(String query)
{
return queryResultSet;
}
// Getters and Setters
}

这是在 NetBeans 7.3 中创建的 Java Web 项目,位于默认包内的 Customer.java 类中。

最佳答案

当您指的是 + 时,您似乎使用了 .

也许是一位老 PHP 程序员? :-)

关于java - 通过方法传递的变量的 "Cannot find symbol",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16678460/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com