sample code on learning Java