@geraldnlang You use an abstract class when you want to create a bunch of common methods/attributes that will be inherited (reused). Interfaces are useful when you have a collection of classes that must implement the same methods, but there won't be reuse.
at 1:20, how did you pass car1 to the method travel, before you casted car1 to vehicle? If travel takes a vechicle parameter, shouldnt you have to cast car to vehicle first?
Very clear, well taught. Thanks!
tomhsharky 1 month ago
Thank you very much. :)
gatoo23 4 months ago
Comment removed
LikeTotallyEMB 6 months ago
for a card game, would you use an interface or an abstract class? :|
geraldnlang 7 months ago
@geraldnlang You use an abstract class when you want to create a bunch of common methods/attributes that will be inherited (reused). Interfaces are useful when you have a collection of classes that must implement the same methods, but there won't be reuse.
carlislemc 7 months ago
Good video, pretty informative :D
pavichokche 11 months ago
thanks very much
more videos on java please?
Could you do one on casting objects?
I don't understand that fully
I know it takes loads of time to make these videos, but it's worth asking :P
dewi20 1 year ago
Excellent video!!! now I can get program for Java Prog. II done! lol
emeraldmorn 1 year ago
Thanks that was very helpful
Durthalion 2 years ago
at 1:20, how did you pass car1 to the method travel, before you casted car1 to vehicle? If travel takes a vechicle parameter, shouldnt you have to cast car to vehicle first?
itsmancini 2 years ago
Since the class Car implements the interface Vehicle, you can pass it to travel (which requires a Vehicle) without having to do a typecast.
carlislemc 2 years ago
Yes, I did mean "interface Vehicle". Sorry about that!
carlislemc 2 years ago