

{"id":115686,"date":"2023-07-01T09:00:10","date_gmt":"2023-07-01T03:30:10","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=115686"},"modified":"2023-07-01T13:03:56","modified_gmt":"2023-07-01T07:33:56","slug":"kotlin-hello-world-program","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/","title":{"rendered":"Kotlin Hello World Program"},"content":{"rendered":"<p>Kotlin is a modern programming language developed by JetBrains. In this article, we will explore how to write a Hello World program in Kotlin. Let&#8217;s start!!!<\/p>\n<h3>Writing the Hello World Program in Kotlin:<\/h3>\n<p>Let&#8217;s dive into the process of creating and executing a Hello World program in Kotlin.<\/p>\n<h4>Step 1: Set Up the Development Environment<\/h4>\n<p>Make sure you have Kotlin installed on your machine. You can obtain the Kotlin compiler from the official Kotlin website or utilize Kotlin plugins available in popular Integrated Development Environments (IDEs) such as IntelliJ IDEA or Android Studio.<\/p>\n<h4>Step 2: Create a New Kotlin File:<\/h4>\n<p>Launch your preferred IDE like Vs code and create a new Kotlin file. Give it a meaningful name, such as &#8220;HelloWorld.kt&#8221;.<\/p>\n<h4>Step 3: Write the Hello World Program:<\/h4>\n<p>Within the newly created file, add the following code.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">fun main(args : Array&lt;String&gt;) {\r\n    println(\"Hello, World! Welcome To DataFlair Kotlin Tutorial\")\r\n}\r\n\r\nOutput \r\nHello, World! Welcome To DataFlair Kotlin Tutorial\r\n<\/pre>\n<p>In this code, the<strong> main()<\/strong> function serves as the entry point of the program. Using the <strong>println()<\/strong> function, we display the <strong>&#8220;Hello, World! Welcome To DataFlair Kotlin Tutorial&#8221;<\/strong> message on the console.<\/p>\n<p>In this code, we have a Hello World program in Kotlin. Let&#8217;s understand each component briefly:<\/p>\n<h4>a. fun main(args : Array&lt;String&gt;):<\/h4>\n<p>This line declares the main function, which serves as the entry point of the program. In Kotlin, the main function is where the program execution begins. It takes an array of strings (args) as a parameter, which can be used to pass command-line arguments.<\/p>\n<h4>b. println(&#8220;Hello, World! Welcome To DataFlair Kotlin Tutorial&#8221;)<\/h4>\n<p>This line uses the println() function to print the message &#8220;Hello, World! Welcome To DataFlair Kotlin Tutorial&#8221; to the console. The println() function is a built-in Kotlin function used to display text with a newline character at the end. In this case, it displays the &#8220;Hello, World! Welcome To DataFlair Kotlin Tutorial&#8221; message.<\/p>\n<h4>Step 4: Run the Program<\/h4>\n<p>Compile and run the program using the Kotlin compiler or the IDE&#8217;s built-in features. You should observe the output &#8220;Hello, World! Welcome To DataFlair Kotlin Tutorial&#8221; printed in the console.<\/p>\n<h3>Conclusion<\/h3>\n<p>In this article, we explored the process of creating a Hello World program in Kotlin. With Kotlin&#8217;s simplicity and expressive nature, you are now equipped to embark on your programming journey confidently.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kotlin is a modern programming language developed by JetBrains. In this article, we will explore how to write a Hello World program in Kotlin. Let&#8217;s start!!! Writing the Hello World Program in Kotlin: Let&#8217;s&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":115688,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27775],"tags":[27814],"class_list":["post-115686","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kotlin-tutorials","tag-kotlin-hello-world-program"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Kotlin Hello World Program - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn how to write a Hello World program in Kotlin. See various steps like installation, creating new file, writing and running the program.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kotlin Hello World Program - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn how to write a Hello World program in Kotlin. See various steps like installation, creating new file, writing and running the program.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-01T03:30:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-01T07:33:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/06\/kotlin-hello-world-program.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Kotlin Hello World Program - DataFlair","description":"Learn how to write a Hello World program in Kotlin. See various steps like installation, creating new file, writing and running the program.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/","og_locale":"en_US","og_type":"article","og_title":"Kotlin Hello World Program - DataFlair","og_description":"Learn how to write a Hello World program in Kotlin. See various steps like installation, creating new file, writing and running the program.","og_url":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-07-01T03:30:10+00:00","article_modified_time":"2023-07-01T07:33:56+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/06\/kotlin-hello-world-program.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"Kotlin Hello World Program","datePublished":"2023-07-01T03:30:10+00:00","dateModified":"2023-07-01T07:33:56+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/"},"wordCount":373,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/06\/kotlin-hello-world-program.webp","keywords":["kotlin hello world program"],"articleSection":["Kotlin Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/","url":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/","name":"Kotlin Hello World Program - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/06\/kotlin-hello-world-program.webp","datePublished":"2023-07-01T03:30:10+00:00","dateModified":"2023-07-01T07:33:56+00:00","description":"Learn how to write a Hello World program in Kotlin. See various steps like installation, creating new file, writing and running the program.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/06\/kotlin-hello-world-program.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/06\/kotlin-hello-world-program.webp","width":1200,"height":628,"caption":"kotlin hello world program"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/kotlin-hello-world-program\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Kotlin Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/kotlin-tutorials\/"},{"@type":"ListItem","position":3,"name":"Kotlin Hello World Program"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/115686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=115686"}],"version-history":[{"count":3,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/115686\/revisions"}],"predecessor-version":[{"id":115784,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/115686\/revisions\/115784"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/115688"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=115686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=115686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=115686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}