• Post Reply Bookmark Topic Watch Topic
  • New Topic

this is a weird porblem please help?  RSS feed

 
waqas imtiaz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to assess a method which is public from servlet. but it gives weird error. image has been attached please view this image and please help me on fixing this problem
thanks
error.png
[Thumbnail for error.png]
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seen as both classes are in different packages - which should have lowercase names by the way - it might be that the GameRoomPlayerListWindow has the default package private visibility. Make it explicitly public if that's the case.
 
waqas imtiaz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jelle Klap wrote:Seen as both classes are in different packages - which should have lowercase names by the way - it might be that the GameRoomPlayerListWindow has the default package private visibility. Make it explicitly public if that's the case.


How to change that to public?
 
waqas imtiaz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jelle Klap wrote:Seen as both classes are in different packages - which should have lowercase names by the way - it might be that the GameRoomPlayerListWindow has the default package private visibility. Make it explicitly public if that's the case.


Please help me how to change that?
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the variable "gameRoom"? The getGameRoomPlayerListWindow() method in it should have public access because you are trying access it in different package.
 
Tony Docherty
Bartender
Posts: 3271
82
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PatienceIsAVirtue (← click)

Without seeing the whole class it's hard to be sure what is happening hence Jelle saying " it might be ...". But you need to check to see what visibility the class currently has and if it is not public you need to change it to public. If you don't know how to do that read http://docs.oracle.com/javase/tutorial/reflect/class/classModifiers.html.

 
waqas imtiaz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tony Docherty wrote:PatienceIsAVirtue (← click)

Without seeing the whole class it's hard to be sure what is happening hence Jelle saying " it might be ...". But you need to check to see what visibility the class currently has and if it is not public you need to change it to public. If you don't know how to do that read http://docs.oracle.com/javase/tutorial/reflect/class/classModifiers.html.



Thanks man it's been fixed. Actually class was not public now fixed
Thank you every one for helping me take care
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!