Even odd program in java using ternary operator