. 𝚂𝚎𝚛𝚊𝚙𝚑𝚒𝚗𝚊 ~ 👠
JCHJava Community | Help. Code. Learn.
•Created by . 𝚂𝚎𝚛𝚊𝚙𝚑𝚒𝚗𝚊 ~ 👠 on 10/6/2024 in #java-help
Convert boolean inside if statement
Hello, I am working on a program where I am using a particular logic for a flag, I am declaring a boolean variable, and then making an if statement that executes if the statement and then add value to an array, but I want to alternatively add values to my array. EG I have 1001 I want to add 1 in array1, 0 in both arrays, 0 in both arrays, 1 in array1. This is how I have written this in code. But the problem is that the boolean is always true, it doesn't get flase even after the if statement has executed. This is my code:
28 replies