some common java codes samples