pandas 缺失值处理指南:理解 NaN 语义、传播规则与 isna/dropna/ffill/fillna 实战
2026/9/19 4:32:05
packageoopDemo.test03;//class-类的关键字,类名Car,类的创建publicclassCar{publicintwheels=4;//类的属性以及赋值voidrun(){//类的方法System.out.println("能开动");}}packageoopDemo.test03;//class-类的关键字publicclassApplication{staticvoidmain(String[]args){//类对象的创建,类对象car01Carcar01=newCar();car01.run();}}packageoopDemo.test03;publicclassCar{publicintwheels=4;//类的属性voidrun(){//类的方法System.out.println("能开动");}publicCar(intwheels){this.wheels=wheels;//this关键字,指向当前对象;super关键字,指向父级对象System.out.println("我是构造器");}}packageoopDemo.test03;publicclassCar{publicintwheels=4;//类的属性privateStringCarlicenseCode;//设置成私有属性,达到封装voidrun(){//类的方法System.out.println("能开动");}publicvoidSetCarlicenseCode(){//为私有属性设置get方法this.CarlicenseCode=CarlicenseCode;}publicStringgetCarlicenseCode(){//为私有属性设置set方法returnCarlicenseCode;}publicCar(intwheels){this.wheels=wheels;//this关键字,指向当前对象;super关键字,指向父级对象System.out.println("我是构造器");}privatevoidtest(){//方法也可私有,也是封装System.out.println("方法也私有了哦");}}packageoopDemo.test03;publicclassBMWCarextendsCar{publicBMWCar(intwheels){super(wheels);}}packageoopDemo.test03;publicclassBMWCarextendsCar{publicBMWCar(intwheels){super(wheels);}@Override//父类方法重写voidrun(){super.run();}}packageoopDemo.test03;publicclassApplication{staticvoidmain(String[]args){//car01和car02都是具体对象,一个左侧是Car类实例化,一个是BMWCar,这就是多态Carcar01=newBMWCar(4);BMWCarcar02=newBMWCar(4);car01.run();}}packageoopDemo.Test;//抽象类--关键字abstractpublicabstractclassAbstractDemo01{publicabstractvoiddosomething();//抽象方法:没有方法体publicvoidtest(){//这个是普通方法,有方法提System.out.println("----");}}packageoopDemo.Test;//抽象类的方法必须重写,去实现他父类的方法publicclassAextendsAbstractDemo01{@Overridepublicvoiddosomething(){System.out.println("重写的方法");}}packageoopDemo.test03;//关键字interfacepublicinterfaceTimerService{voidtimer();//没有方法体}packageoopDemo.test03;//关键字implements, TimerService--这个是接口,这个UserServiceImpl是接口实现publicclassUserServiceImplimplementsTimerService{@Overridepublicvoidtimer(){//接口需要方法重写System.out.println("实现接口timer方法");}}publicclassUserServiceImplimplementsUserService,TimerService{}