How can you tell if your Android app is using Kotlin or Java in Android Studio?

Viewed 805

How can you tell if your Android app is using Kotlin or Java in Android Studio?

I am extremely new to Android app creation still.

I have looked at the code, but I am enough of a novice that it is hard to tell for sure.

I tried Googling this question and all that seems to come up is articles about which to use, java or Kotlin.

Please help. Thanks.

2 Answers

Just Check your Activity Name

For Java App

MainActivity.java -> (.java) -> It's Java App

For Kotlin App

MainActivity.kt -> (.kt) -> It's Kotlin App

Kotlin files have extensions .kt, Java ones .java. besides that easiest way for distinguishing would be to check semicolons ; at the end of some/most of lines in Java, while in Kotlin they aren't required. another way: in Kotlin you will find val and var keywords, commonly used and not present in Java code

if you don't know how to distinguish two languages then probably you should start some coding learning, not opening some foreign project

Related