lesson4:added abstract class for sharing code