Learning OOPs using java