java中抽象類和抽象方法到底什么關(guān)系
抽象類和抽象方法什么關(guān)系?抽象類中可能有抽象方法,也可能沒有抽象方法。那位說,就跟沒說一樣,那抽象類和抽象方法都叫抽象,他們必定有關(guān)系,那關(guān)系是什么呢?如果一個(gè)類中有抽象方法,它必須得是抽象類。
馬克- to-win:馬克 java社區(qū):防盜版實(shí)名手機(jī)尾號(hào): 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.