-1

The following statement shows an error :

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

The error higlighted by the IDE is :

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

Why am I getting this error though I have imported the correct class (org.jivesoftware.smack.packet.Presence)?

saplingPro
  • 19,801
  • 53
  • 136
  • 190

5 Answers5

3

Because keyword new is missing. Try following:

Presence p_tester = new Presence(Presence.Type.available,"having lunch",1,
                                                       Presence.Mode.available);
Mikko Maunu
  • 40,186
  • 9
  • 129
  • 132
0

You need to add new before calling the constructor.

BobTheBuilder
  • 18,283
  • 5
  • 37
  • 60
0
cannot find symbol
symbol: method Presence(Type,String,int,Mode)

BECAUSE you are missing new keyword

so try

Presence p_tester = new Presence(Presence.Type.available,"having lunch",1,
                                                       Presence.Mode.available);
Tarsem Singh
  • 13,979
  • 7
  • 50
  • 70
0

Keyword new is missing. Try this:-

Presence p_tester = new Presence(Presence.Type.available,"having lunch",1,
                                                       Presence.Mode.available);
Rahul Tripathi
  • 161,154
  • 30
  • 262
  • 319
0

May be the constructor : Presence(Presence.Type.available,"having lunch",1, Presence.Mode.available) does not exists or is not accessible.

IBJ
  • 31
  • 3