Java Programming code example