Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - bad operand types for binary operator '||'
first type: boolean
second type: int
at variouscases.VariousCases.main(VariousCases.java:53)
All things are lawful, but not all things are profitable.
Knute Snortum wrote:Each "thing" between the || needs to be a condition, or evaluate to a boolean, so
if that's what you mean.
Stef Aucky wrote:we cant do a = b or c .
As the second isn't a boolean, it become a statement as the or operand ended the previous boolean?
Stef Aucky wrote:also i realise now my logic is fundamentally flawed anyways, may i delete this thread??
Stef Aucky wrote:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - bad operand types for binary operator '||'
first type: boolean
second type: int
at variouscases.VariousCases.main(VariousCases.java:53)
any tips, Thanks
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
OCPJP 1.6
Loganathan Karunakaran wrote:probably you want to put the line int b = 0; before the for loop.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Stan Austin wrote:also what is the thing about printing the value of an array compared to printing the address i was told to watch out for doing this, but haven't actually got it wrong yet (even trying to) :/
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |