Pages

Footer Pages

Spring Boot

Java String API

Java Conversions

Kotlin Programs

Kotlin Conversions

Java Threads Tutorial

Java 8 Tutorial

Monday, April 27, 2020

Kotlin Hello World - You First Kotlin Program

Kotlin Hello World Program - 

Your First Program in Kotlin, Hello World Example in Kotlin.

In this post, We will learn how to write Hello World in Kotlin Programming Language.

You can get the Kotlin perspective in eclipse from link here step by step explanation with screenshots.

This is part of Kotlin Tutorial series.


Kotlin Hello World - You First Kotlin Program

Official Guide for eclipse



Kotlin Hello World - You First Kotlin Program

You have to install Kotlin plugin for eclipse then have to move to Kotlin perspective.

Kotlin Hello World Example Program:

First, Let us write a simple kotlin program that prints "Hello World" on the console.
[package com.adeepdrive.kotlin.example
fun main(args: Array<String>) {
    println("Hello World");
}]

Output:

Hello World

Explanation:

1. package com.javaprogram.kotlin.example

   This is similar to the packages in Java.

More about Java packages

2. fun main(args: Array<String>) {

   fun: fun is a keyword in Kotlin.
   main: main is function in Kotlin programming language which is default invoked.
   args: args is a array which is type of String.
  

3. println: println is a kotlin built in function to print the content to the console.


Kotlin Hello World

Your First Kotlin Program


No comments:

Post a Comment

Please do not add any spam links in the comments section.