public class Main
{
public static void main(String[] args) {
Alarm_Clock a=new Alarm_Clock("07:13.23");
System.out.println("Current time: "+a.getCurrentTime());
}
}
class Clock{
private String current_time;
protected String getCurrentTime(){
return current_time;
}
public Clock(String c ){
current_time=c;
}
}
class Alarm_Clock extends Clock{
public Alarm_Clock(String c){
super(c);
}
}
Comments
Leave a comment