java中抽象类和抽象方法到底什么关系
抽象类和抽象方法什么关系?抽象类中可能有抽象方法,也可能没有抽象方法。那位说,就跟没说一样,那抽象类和抽象方法都叫抽象,他们必定有关系,那关系是什么呢?如果一个类中有抽象方法,它必须得是抽象类。
马克- to-win:马克 java社区:防盗版实名手机尾号: 73203。
An abstract class may have no abstract method,such as the following class Car. 马 克- t o --wi n: At this time,the only point and the meaning of abstract class is that we can not instantiated the class, because it is abstract class.Why an abstract class can have a nonabstract method? what is the point? also in logic, think over the following example, car is a bit abstract in that you dont' know exactly whether it is a truck or a jeep or a limersine, 马克-to-win:so it is defined as a abstract class. but no matter whether it is truck,jep, or limersine, it definitely use steering wheel. so its steer() method is an ordinary method instead of an abstract method. )
Abstract class can’t be instantiated.