Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

extend abstract class and compiler  RSS feed

 
hassan ali
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello

-1 if i have a abstract class
2-then i extend it in three deferent classes

3-then i have put them in vector
hassan[i ]
4-then i have overload function in all three class (move)
5- when i try to call this method (hassan.move ) by index

how compiler work with this reference that are deferent but have function with same name

friend told me compiler does not compile this line and write as it is.
and at run time it will be compiled .---------is that correct?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by hassan ali:
friend told me compiler does not compile this line and write as it is.
and at run time it will be compiled .---------is that correct?


Why don't you try it yourself and see what happens?
Trying things out yourself is the best way to learn.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!