File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

incompatable types.

 
theodore sklavenitis
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator






thanks to everyone that responed to my previous problem.Here in my displaytable method my if statments give me an error that say incompatable types required boolean found int.Any tips?
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use "==" to compare variables. "=" is used for assignment.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47300
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and why are you using all those if blocks rather than

array[n]++

?
 
Marcin Majewski
Greenhorn
Posts: 14
IntelliJ IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not allowed to place assignments (=) in if statements. You are only allowed to make comparisons in if statements (==) and call methods that return boolean. This is a Java build-in security checking mechanism.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marcin Majewski wrote:You are not allowed to place assignments (=) in if statements.


 
Marcin Majewski
Greenhorn
Posts: 14
IntelliJ IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good point. Thanks.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47300
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . which is why using == true or == false is not only bad style, but potentially error-prone if you writey = instead of ==.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic