private String getWhoozitYs(){ StringBuffer sb = new StringBuffer(); boolean stop = generator.nextBoolean(); if(stop = true) { sb.append(\"y\
if(stop == true)
or
if(stop)
= is for assignment.
== is for checking condition.
if(stop = true)
It will assign true to stop and evaluates if(true). So it will always execute the code inside if because stop will always being assigned with true.