added a few java codes

added a few java codes