帮助解决小错误 - JAVA

发布于 2024-10-25 20:19:06 字数 572 浏览 3 评论 0原文

您好,只是一个简单的问题..

我已经从已扫描的字符串构造了一个对象 clientdetailslist

      ClientDetails clientdetailslist = new ClientDetails(client_ID,
                title, initials, surname, clientname,
                street, townorcity, postcode, clientaddress);

但是 new 之后的 ClientDetails 给出了错误,我不明白为什么。我认为这可能是班级的问题,但我很确定它没问题。任何帮助都会很棒,因为我真的不明白为什么:|

编辑:错误消息来自 NetBeans 阅读:

找不到符号符号:构造函数 客户端详细信息(java.lang.String 等 等)位置类:ClientDetails

PS 会发布图片,但我没有代表。

抱歉,如果信息不够。如果您确实需要更多,请发表评论,我会尽快提供。谢谢

Hi just a quick question..

I've constructed an object clientdetailslist from Strings which have been scanned in

      ClientDetails clientdetailslist = new ClientDetails(client_ID,
                title, initials, surname, clientname,
                street, townorcity, postcode, clientaddress);

However the ClientDetails which comes after new is giving an error and I can't see why. I thought it might be a problem with the class but I'm pretty certain it's fine. Any help would be great as I really can't work out why :|

Edit : the error message is one from NetBeans reading:

cannot find symbol symbol: constructor
Clientdetails(java.lang.String etc
etc) location class: ClientDetails

PS would of posted a pic but I don't have the rep.

Sorry if it's not enough info. If you do need more just comment and Ill get it up ASAP. Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浪菊怪哟 2024-11-01 20:19:06

也许是你的大小写(因为 Java 区分大小写)。客户详细信息 != 客户详细信息

Perhaps it is your capitalization (since Java is case sensitive). ClientDetails != Clientdetails

梦情居士 2024-11-01 20:19:06

看来问题很可能出在 ClientDetails 类中。

创建自己的类时,它需要有一个构造函数方法,在本例中,它将采用以下形式:

 public ClientDetails(Parameters){
//Enter code here
}

Netbeans 错误是一个编译器错误,表明 ClientDetails 没有构造函数方法。因此,您尝试在 ClientDetails 类中实际存在的方法不存在的情况下调用 ClientDetails 构造函数。

要解决此问题,您需要访问 ClientDetails 以添加到构造函数中(或者如果存在则将其公开)。

It seems that the problem is most likely in the ClientDetails class.

When creating your own class, it needs to have a constructor method, in this case it would be of the form:

 public ClientDetails(Parameters){
//Enter code here
}

That Netbeans error is a compiler error that is suggesting that ClientDetails does not have a constructor method. Therefore you are trying to call the ClientDetails constructor without the method actually existing in the ClientDetails class.

To fix this you need access to ClientDetails to add in the constructor (or if it exists to make it public).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文