-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
  • 20,769
  • 53
  • 137
  • 195

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
  • 41,366
  • 10
  • 132
  • 135
0

You need to add new before calling the constructor.

BobTheBuilder
  • 18,858
  • 6
  • 40
  • 61
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
  • 14,139
  • 7
  • 51
  • 71
0

Keyword new is missing. Try this:-

Presence p_tester = new Presence(Presence.Type.available,"having lunch",1,
                                                       Presence.Mode.available);
Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
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