接口和抽象類的區別

接口是抽象方法的集合,只定義一系列方法但是並不實現 public interface CalInterface { final float PI=3.14159f;//定義用於表示圓周率的常量PI    float getArea(float r);//定義一個用於計算面積的方法getArea()    float getCircumference(float r);//定義一個用於計算周長的方法
相關文章
相關標籤/搜索