Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » Java && Operator Not Working(Java's && operator is not working properly.)
Java && Operator Not Working [message #1847901] Fri, 12 November 2021 02:21
Nathan Eclipse is currently offline Nathan EclipseFriend
Messages: 1
Registered: November 2021
Junior Member
Java's && operator is supposed to only evaluate the right hand side of the expression only if the left hand side expression is true. However, in my code, it is not working as intended.

Here is my code:
boolean up = x > 0,/*More Code*/
if (up && (dat[x-1][y]==target)) /*More Code*/

Obviously, the right hand side would only be evaluated if the first is true. The first is false, as is told by the ArrayIndexOutOfBoundsException that is thrown when running the program.
Previous Topic:Update site for 2.5.1 contains actually 2.5.1-M3?
Next Topic:[Inquiry] RCPTT 2.5.2 target release date
Goto Forum:

Current Time: Sat Mar 02 13:42:46 GMT 2024

Powered by FUDForum. Page generated in 0.02046 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top