java samples codes