Simple programs in java