2009年2月9日 星期一

第52題

Place the code fragments in position to complete the Displayable interface.

interface Reloadable{
public void reload();
}
class Edit{
public void edit(){/* Edit Here */}
}
interface Displayable
Place here Place here{
Place here
}
Code Fragments
extends
public void display();
Reloadable
implements
public void display(){/* Diaplay */}
Edit

答案:

interface Displayable
extends Reloadable{
public void display();
}
參考:6-5 繼承、7-6 介面
---------------------------------------
主要考介面的觀念
Displayable 是一個介面,介面只能繼承介面,繼承父介面後可以自己建立一個新的方法

沒有留言:

張貼留言