找不到符号方法 [英] Cannot Find Symbol method

查看:118
本文介绍了找不到符号方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助一个项目从100现在把它归结为5个错误现在我不知道该做什么。

please help been working on a project got it down to 5 errors from 100 now i have no idea what to do.

展开 | 选择 | 换行 | 行号

推荐答案

[HTML] ps.setString(1,getPet()。getName()); //设置名称

ps.setInt(2,getPet()。getLevel()); //设置等级

ps.setInt(3,getPet()。getCloseness()); //设置贴近度

ps.setInt(4,getPet()。getFullness()); //设置丰满度

ps.setInt(5,getPet()。getUniqueId()); //设置ID [/ HTML]


老兄,实际上你的代码只显示这些行中的错误。我们是否可以像这样使用方法调用。 getPet()是类中的bean方法。使用它如何调用getLevel()方法。尝试创建一个对象并使用object访问这些方法。更好的是你给我发布包含getName(),getLevel()方法的Bean类


问候

Ramanan Kalirajan
[HTML]ps.setString(1, getPet().getName()); // Set name
ps.setInt(2, getPet().getLevel()); // Set Level
ps.setInt(3, getPet().getCloseness()); // Set Closeness
ps.setInt(4, getPet().getFullness()); // Set Fullness
ps.setInt(5, getPet().getUniqueId()); // Set ID [/HTML]

Hi dude, actually your code is showing error in these lines only. Whether can we use method calling like this. getPet() is a bean method in a class. Using that how can you call getLevel() method. Try to create a object and access those methods using object. Better you just post me with the Bean Class which contains getName(), getLevel() methods

Regards
Ramanan Kalirajan


转移到java-forum ... javaScript!= java :)


亲切的问候
moved to java-forum ... javaScript != java :)

kind regards


根据编译器,你的GetPet方法返回一个Object类型的对象,而Object类没有你想要调用的任何方法。

另请注意你收到的警告。


PS在发布代码时使用代码标签,仅发布代码的相关部分。
According to the compiler, your GetPet method returns an object of type Object and the Object class doesn''t have any of those methods you are trying to call.
Notice also the warnings you are getting.

P.S Use code tags when posting code and post only the relevant parts of the code.


这篇关于找不到符号方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆