Java tutorial for friend