Java boolean primitive

Can I do this in java? private static boolean isRight(){ return new Random.nextBolean(); } boolean test = true; test = test && isRight() My question is can I use a boolean to update the …