Why is my code outputting this?
Hi, I am very new to Solo Learn and Java in general, so I apologize if I posted this wrong or if my error is blatantly obvious. This is my code. public class Program { public static void main(String[] args) { boolean jq = true; boolean andrew = true; boolean jack = true; boolean finn = true; boolean jonathan = false; boolean sean = true; boolean jay = false; boolean danny = false; boolean ethan = false; int randoms = 0; int probability = 0; if(jq = true){ ++probability; }else if(jq = false){ probability=probability; } if(andrew = true){ ++probability; }else if(andrew = false){ probability=probability; } if(jack = true){ ++probability; }else if(jack = false){ probability=probability; } if(finn = true){ ++probability; }else if(finn = false){ probability=probability; } if(jonathan = true){ ++probability; }else if(jonathan = false){ probability=probability; } if(sean = true){ ++probability; }else if(sean = false){ probability=probability; } if(jay = true){ ++probability; }else if(jay = false){ probability=probability; } if(danny = true){ ++probability; }else if(danny = false){ probability=probability; } if(ethan = true){ ++probability; }else if(ethan = false){ probability=probability; } System.out.println(probability); } } My question is why is my code outputting 9 when only 5 of the booleans are true?