https://kotlinlang.org logo
#android
Title
# android
o

Ofir Bar

07/14/2020, 5:18 PM
Hey guys, junior here
Car
is a class, which extends an abstract class
Vehicle
I didn't write a constructor for
Vehicle
. why the compiler complains?
z

Zach Klippenstein (he/him) [MOD]

07/14/2020, 5:23 PM
It just means you need to put
()
after
Vehicle
, which is a constructor invocation
All classes have constructors. If you don’t explicitly write one, they have an implicit default constructor.
o

Ofir Bar

07/14/2020, 5:25 PM
But
Vehicle
is an abstract class. How is it possible that it has an implicit constructor? @Zach Klippenstein (he/him) [MOD]
z

Zach Klippenstein (he/him) [MOD]

07/14/2020, 5:29 PM
o

Ofir Bar

07/14/2020, 5:31 PM
Thanks a ton @Zach Klippenstein (he/him) [MOD]
z

Zach Klippenstein (he/him) [MOD]

07/14/2020, 5:35 PM
Also you might want to check out #getting-started
1