-1

以下语句显示错误:

Presence p_tester = Presence(Presence.Type.available,"having lunch",1,
                                                       Presence.Mode.available);

IDE突出显示的错误是:

cannot find symbol
symbol: method Presence(Type,String,int,Mode)

尽管我导入了正确的类,但为什么会出现此错误 (org.jivesoftware.smack.packet.Presence)

4

5 回答 5

3

new因为缺少关键字。尝试以下操作:

Presence p_tester = new Presence(Presence.Type.available,"having lunch",1,
                                                       Presence.Mode.available);
于 2013-08-18T07:59:45.590 回答
0

您需要new在调用构造函数之前添加。

于 2013-08-18T08:00:08.727 回答
0
cannot find symbol
symbol: method Presence(Type,String,int,Mode)

因为您缺少new关键字

所以试试

Presence p_tester = new Presence(Presence.Type.available,"having lunch",1,
                                                       Presence.Mode.available);
于 2013-08-18T08:00:37.157 回答
0

new缺少关键字。尝试这个:-

Presence p_tester = new Presence(Presence.Type.available,"having lunch",1,
                                                       Presence.Mode.available);
于 2013-08-18T08:00:47.470 回答
0

可能是构造函数:Presence(Presence.Type.available,"have lunch",1, Presence.Mode.available) 不存在或不可访问。

于 2013-08-18T08:00:49.310 回答