Array Logical Programming Questions In Java