You are on page 1of 5

Polymorphism, Interface (week 4)

Lecture 4, Object Oriented Programming

Kichun Lee
skylee@hanyang.ac.kr
Task 1

 Slide 9 의 클래스 구조에서 Employee 를 상속받는 Parttimer 클래스를


추가해보시오 .

 Slide 9 의 클래스 구조에서 Employee 는 Ablevacation 인터페이스를


구현하도록 해보시오 .
public interface Ablevacation
{
public void startVacation(int days);
public void forceToendVacation();
public boolean isVacation();
public int howManyVacationDays();
}

2
Task 2

 System.currentTimeMillis() 를 테스트해보시오 .
• http://download.oracle.com/javase/1.5.0/docs/api/java/lang/System.html#currentTimeMillis()

 Secret.java 를 참고하여 Encryptable 를 구현하는 나만의 MySecret.java 를


만들어보시오 .
– By default the seed number that is used by:
– Random rand = new Random();
– is the current time in milliseconds since January 1, 1970.
– Normally this will produce sufficiently random numbers for most purposes.

– System.currentTimeMillis() 을 이용한 다른 seed 를 사용하도록 만들어보시오 .


– 또는 shift 를 다르게 만들어도 괜찮습니다 .

 Secret 와 MySecret 이 Comparable 인터페이스를 구현하도록


구현해보시오 .

3
Task 3

 첨부하는 RationalNumber.java 를 실행하는 Test Driver 를


만들어보시오 .

 Comparable 인터페이스를 구현하도록 바꾸어보시오 .

4
Task 4

 URLDissector.java 를 실행해보시오

You might also like