第1关:接口的定义与使用-学生还是老师
interface Introduce {
void introduction();
}
class Student implements Introduce {
public void introduction(){
System.out.println("我是一名学生!");
}
}
class Teacher implements Introduce {
public void introduction(){
System.out.println("我是一名老师!");
}
}
第2关:接口应用:充电器接口的实现
package guet;/**
* @author JS
* @creat 2021-03-29-上午 10:21
*/
/**
*类功能描述
*@Authorkeyter
*@Date 2021/3/29 上午 10:21
*/
public class Charger implements ICharger{
public boolean connectPowerline(float voltage){
if(voltage>=200 && voltage<=240){
return