Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

int cannot be dereferenced

 
Tahir Mehmood
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


[Edit - added code tags - MB]
 
Rajkamal Pillai
Ranch Hand
Posts: 445
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thread.getPriority() returns an int value which you have assigned to the variable 'prty'. By using prty.equals(1) you are trying to access it as a java.lang.Integer. In your case use:



 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to The Ranch!
 
Tahir Mehmood
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! Mathew Brown
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic