could anyone explain what is the difference betwee...
# announcements
p
could anyone explain what is the difference between creating a kotlin file and a kotlin class? Does a class convert into a file if I add a function outside of the class? Does a file turn into a class if I remove it later? I am confused.
k
The only difference I can see is that a file is initially empty in your editor
c
with Kotlin it's just an aesthetics and terminology thing
a
the difference is that
Kotlin file
creates a file with just the package declaration and
Kotlin class
a file with the package declaration and an empty class
p
also, if you create it as class it doesnt show the
kt
extension in
Project
window.. ever
😞
c
Huh, for me it does. When I make it a "file" it shows .kt, when I remove "file" features and it becomes a class .kt disappears. At least that's what I remember, I'm on my wintendo now, so can't check.
1