Convert Android Java File to Kotlin File

Let’s start this activity with one example. You can pick any example in this case. Here I just want to showcase that all the existing Android Java files(entire application) can be converted to Kotlin syntax.

So I am going to consider one of my existing Android Java file, which is used to process for Binary search logic.

HelloWorld.java

 

Output

 

convert Java to Kotlin file
convert Java to Kotlin file

 

Once converted the Java to Kotlin, file extension will also be changed from (.java) to (.kt).

 

Output

Mind a note, comment section will not be changed. Thats the reason, output is same. You can manually modify it.

 

If you have some doubt then I recommend you to have a look on above video for more better understanding. You can put your question also in the comment section below.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.