<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kotlin on Siberoloji</title><link>https://www.siberoloji.com/kotlin-programming/</link><description>Recent content in Kotlin on Siberoloji</description><generator>Hugo</generator><language>en</language><atom:link href="https://www.siberoloji.com/kotlin-programming/index.xml" rel="self" type="application/rss+xml"/><item><title>Understanding Input Handling in Kotlin: readln(), readLine(), and readlnOrNull()</title><link>https://www.siberoloji.com/understanding-input-handling-in-kotlin-readln-readline-and-readlnornull/</link><pubDate>Sat, 15 Feb 2025 00:00:00 +0000</pubDate><guid>https://www.siberoloji.com/understanding-input-handling-in-kotlin-readln-readline-and-readlnornull/</guid><description>&lt;p&gt;Input handling is a fundamental aspect of programming, enabling interaction between users and applications. In Kotlin, the standard library provides several functions to read input from the console, including &lt;code&gt;readLine()&lt;/code&gt;, &lt;code&gt;readln()&lt;/code&gt;, and &lt;code&gt;readlnOrNull()&lt;/code&gt;. While these functions serve similar purposes, they differ in behavior, return types, and error-handling strategies. This article explores their distinctions, use cases, and best practices for leveraging them effectively.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id="1-introduction-to-input-functions-in-kotlin"&gt;&lt;strong&gt;1. Introduction to Input Functions in Kotlin&lt;/strong&gt;&lt;a class="td-heading-self-link" href="#1-introduction-to-input-functions-in-kotlin" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Kotlin’s approach to input reading emphasizes safety and clarity. Over time, the language has evolved its APIs to align with modern conventions, leading to the introduction of &lt;code&gt;readln()&lt;/code&gt; and &lt;code&gt;readlnOrNull()&lt;/code&gt; in Kotlin 1.6.0. These newer functions aim to replace &lt;code&gt;readLine()&lt;/code&gt;, which has been part of Kotlin since its early days. Understanding their differences is critical for writing robust and user-friendly code.&lt;/p&gt;</description></item><item><title>Kotlin from the beginning</title><link>https://www.siberoloji.com/kotlin-from-the-beginning/</link><pubDate>Sat, 08 Feb 2025 00:00:00 +0000</pubDate><guid>https://www.siberoloji.com/kotlin-from-the-beginning/</guid><description>&lt;p&gt;Kotlin is a modern programming language that is easy to learn, especially if you already know Java[1]. Kotlin is used to develop Android apps and server-side apps[1][2].&lt;/p&gt;
&lt;p&gt;Here is a plan to learn Kotlin from the beginning:&lt;/p&gt;
&lt;h2 id="kotlin-basics"&gt;&lt;a href="https://www.w3schools.com/KOTLIN/index.php"&gt;Kotlin Basics&lt;/a&gt;&lt;a class="td-heading-self-link" href="#kotlin-basics" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://discuss.kotlinlang.org/t/ability-to-learn-kotlin-for-1st-lang/25183"&gt;Start with Kotlin Docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.android.com/courses/pathways/android-development-with-kotlin-1"&gt;Learn the basics of Kotlin&lt;/a&gt;, including data types, operators, variables, control structures, and nullable versus non-nullable variables.&lt;/li&gt;
&lt;li&gt;Take a Kotlin quiz to gauge your knowledge.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="2"&gt;
&lt;li&gt;&lt;strong&gt;Kotlin environment setup&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Install the required IDE and other software that are essential for &lt;a href="https://www.tutorialspoint.com/kotlin/index.htm"&gt;Kotlin&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;For larger projects, writing and managing Kotlin code on your local machine is &lt;a href="https://www.programiz.com/kotlin-programming"&gt;important&lt;/a&gt;. This allows you to work efficiently with multiple files and dependencies.&lt;/li&gt;
&lt;li&gt;Set up and use Kotlin on your computer for larger development projects.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="3"&gt;
&lt;li&gt;&lt;strong&gt;Learn Kotlin with examples&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Learn by example with clarifying examples[1].&lt;/li&gt;
&lt;li&gt;Use the &amp;ldquo;Try it Yourself&amp;rdquo; editor to learn Kotlin. You can edit the code and view the result in your browser.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="4"&gt;
&lt;li&gt;&lt;strong&gt;Practice Kotlin&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.tutorialspoint.com/kotlin/index.htm"&gt;Develop small software&lt;/a&gt; or projects using Kotlin.&lt;/li&gt;
&lt;li&gt;Create &lt;a href="https://android-developers.googleblog.com/2020/07/learn-android-and-kotlin-with-no-experience.html"&gt;Android&lt;/a&gt; &lt;a href="https://www.youtube.com/watch?v=EExSSotojVI"&gt;apps&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;ol start="5"&gt;
&lt;li&gt;&lt;strong&gt;Advanced Kotlin topics&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;Object-oriented programming[2].&lt;/li&gt;
&lt;li&gt;Generics and Lambda functions[2].&lt;/li&gt;
&lt;li&gt;Coroutines[2].&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Consider these resources for learning Kotlin:&lt;/p&gt;</description></item><item><title>Variable naming rules in Kotlin</title><link>https://www.siberoloji.com/variable-naming-rules-in-kotlin/</link><pubDate>Tue, 23 Jan 2024 18:13:19 +0300</pubDate><guid>https://www.siberoloji.com/variable-naming-rules-in-kotlin/</guid><description>&lt;p&gt;As you know, every variable must have a unique name. Although it may seem problem-free at first, as your software expands, your codes may become difficult to understand. Most of the software developers&amp;rsquo; time is spent reading the code written by others, not writing code.&lt;/p&gt;
&lt;p&gt;If you want the code you write to be easy to read and follow, it is very important to follow the naming rules. The variable name you choose should explain exactly what the variable does. Let&amp;rsquo;s see in order the rules that you are advised to follow so that your code does not become complex and incomprehensible.&lt;/p&gt;</description></item><item><title>Comment Lines in Kotlin Programming</title><link>https://www.siberoloji.com/comment-lines-in-kotlin-programming/</link><pubDate>Sun, 21 Jan 2024 21:10:46 +0300</pubDate><guid>https://www.siberoloji.com/comment-lines-in-kotlin-programming/</guid><description>&lt;p&gt;A computer program consists of various pieces of code coming together and working in harmony. Each block of code does what is expected of it. As time goes on, the program developers who write these codes begin to forget and get confused about which code does what. In addition, a new developer who replaces the developer who left the project must learn the program by reading the codes. In this case, explanations, notes and similar expressions written next to the codes are called comment lines.&lt;/p&gt;</description></item><item><title>Kotlin value assignment and type inference</title><link>https://www.siberoloji.com/kotlin-value-assignment-and-type-inference/</link><pubDate>Sat, 20 Jan 2024 15:23:16 +0300</pubDate><guid>https://www.siberoloji.com/kotlin-value-assignment-and-type-inference/</guid><description>&lt;p&gt;In this article, we will explain some of the finer points you need to know about defining variables in the Kotlin programming language. We have prepared this article in addition to the rules we explained in our previous two articles (&amp;quot;&lt;a href="https://www.siberoloji.com/en/kotlin-variable-and-value-definition/" data-type="post" data-id="696" target="_blank" rel="noreferrer noopener"&gt;Kotlin Variable and Value definition&lt;/a&gt;&amp;quot;, &amp;ldquo;&lt;a href="https://www.siberoloji.com/en/constants-and-variables-in-kotlin/" data-type="post" data-id="706" target="_blank" rel="noreferrer noopener"&gt;Constants and variables in Kotlin&lt;/a&gt;&amp;rdquo;).&lt;/p&gt;
&lt;p&gt;We all know that numbers and letters are different types. While mathematical operations can be performed with numbers, mathematical operations cannot be performed with texts. We should note that this distinction also exists in programming languages. Therefore, every variable must have a type.&lt;/p&gt;</description></item><item><title>Constants and variables in Kotlin</title><link>https://www.siberoloji.com/constants-and-variables-in-kotlin/</link><pubDate>Wed, 17 Jan 2024 23:01:33 +0300</pubDate><guid>https://www.siberoloji.com/constants-and-variables-in-kotlin/</guid><description>&lt;p&gt;We introduced the topic of defining variables and assigning values in the Kotlin programming language in our &lt;a href="https://www.siberoloji.com/en/kotlin-variable-and-value-definition/" data-type="post" data-id="696" target="_blank" rel="noreferrer noopener"&gt;previous article&lt;/a&gt;. In this article, we will take a closer look at assigning values with const and val.&lt;/p&gt;
&lt;h2 id="val-variables"&gt;val variables&lt;a class="td-heading-self-link" href="#val-variables" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The code below defines two variables, an integer containing the constant number &lt;code&gt;pi&lt;/code&gt; and a String value named &lt;code&gt;helloMsg&lt;/code&gt;. These values cannot be changed again after they are first assigned.&lt;/p&gt;</description></item><item><title>Kotlin Variable and Value definition</title><link>https://www.siberoloji.com/kotlin-variable-and-value-definition/</link><pubDate>Wed, 17 Jan 2024 19:01:16 +0300</pubDate><guid>https://www.siberoloji.com/kotlin-variable-and-value-definition/</guid><description>&lt;h2 id="what-is-a-variable"&gt;What is a variable?&lt;a class="td-heading-self-link" href="#what-is-a-variable" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A variable is a record location in which a number, text or any other information is kept. Variables are almost the most important building blocks in programming. There are variables in which these values are kept in all the operations we will perform. We call its name &amp;ldquo;variable&amp;rdquo; because the value stored in it can be changed.&lt;/p&gt;
&lt;p&gt;For example, consider a school and the classes within it. We should record the name of each class somewhere and the number of students in each class somewhere. Each variable must have a name (identifier) to distinguish it from other variables. In this case, we will have two variables that we will refer to as &amp;ldquo;class name&amp;rdquo; and &amp;ldquo;number of students&amp;rdquo;.&lt;/p&gt;</description></item><item><title>Basic Literals in Kotlin</title><link>https://www.siberoloji.com/basic-literals-in-kotlin/</link><pubDate>Thu, 11 Jan 2024 22:48:55 +0300</pubDate><guid>https://www.siberoloji.com/basic-literals-in-kotlin/</guid><description>&lt;p&gt;No matter how complicated, all programming languages perform operations on integers, characters, strings, etc. performed on values. We call these values Literal expressions. It would be very appropriate to explain these types before starting to write a program. These are integers, characters, and strings.&lt;/p&gt;
&lt;h2 id="integers"&gt;Integers&lt;a class="td-heading-self-link" href="#integers" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We constantly use integers to count things in our daily lives and in mathematics. The same integers are also used in Kotlin. All the numbers you see below are integers. For example; 0, 1, 2, 10, 11, 100 If an integer contains many digits, we can split the integer into blocks using _ (underscore) to make it easier to read and understand. For example; Instead of 1000000, we can write it as 1_000_000. This means the same integer for both Kotlins. As long as the underscore is not at the beginning or end of the numbers, it can be used as desired. 1__000_000 , 1_2_3 These expressions are also true. An error occurs when you type &lt;em&gt;10 or 100&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>First Kotlin Program Hello World</title><link>https://www.siberoloji.com/first-kotlin-program-hello-world/</link><pubDate>Mon, 01 Jan 2024 14:13:06 +0300</pubDate><guid>https://www.siberoloji.com/first-kotlin-program-hello-world/</guid><description>&lt;p&gt;When starting to learn programming languages, we always start with the same example. Let&amp;rsquo;s start our Kotlin programming article with the &amp;ldquo;Hello World&amp;rdquo; program without breaking tradition.&lt;/p&gt;
&lt;p&gt;You can copy the code you see below and paste it into your editor, or you can go to the &lt;a href="https://play.kotlinlang.org"&gt;Kotlin Playground&lt;/a&gt; page via your Web browser and try the codes there.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-kotlin" data-lang="kotlin"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#8f5902;font-style:italic"&gt;// First program in kotlin
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;fun&lt;/span&gt; &lt;span style="color:#000"&gt;main&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;()&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#000"&gt;println&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;Hello World&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000;font-weight:bold"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="explanation"&gt;Explanation&lt;a class="td-heading-self-link" href="#explanation" aria-label="Heading self-link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The line that starts with the &lt;code&gt;//&lt;/code&gt; sign is the comment line. The compiler does not accept this line as code. It is used to take notes or make explanations about which code does what.&lt;/p&gt;</description></item><item><title>Checking data type with when() example</title><link>https://www.siberoloji.com/checking-data-type-with-when-example/</link><pubDate>Mon, 28 Feb 2022 20:50:52 +0300</pubDate><guid>https://www.siberoloji.com/checking-data-type-with-when-example/</guid><description>&lt;p&gt;In this short note, you can see an example of when() usage with data type. The type of data will determine the code to run.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-kotlin" data-lang="kotlin"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;val&lt;/span&gt; &lt;span style="color:#000"&gt;x&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt; &lt;span style="color:#000"&gt;Any&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;=&lt;/span&gt; &lt;span style="color:#0000cf;font-weight:bold"&gt;12.75&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;when&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#000"&gt;x&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;is&lt;/span&gt; &lt;span style="color:#000"&gt;Int&lt;/span&gt; &lt;span style="color:#ce5c00;font-weight:bold"&gt;-&amp;gt;&lt;/span&gt; &lt;span style="color:#000"&gt;println&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;$x&lt;/span&gt;&lt;span style="color:#4e9a06"&gt; is an Integer&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;is&lt;/span&gt; &lt;span style="color:#000"&gt;Double&lt;/span&gt; &lt;span style="color:#ce5c00;font-weight:bold"&gt;-&amp;gt;&lt;/span&gt; &lt;span style="color:#000"&gt;println&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;$x&lt;/span&gt;&lt;span style="color:#4e9a06"&gt; is a Double&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;is&lt;/span&gt; &lt;span style="color:#000"&gt;String&lt;/span&gt; &lt;span style="color:#ce5c00;font-weight:bold"&gt;-&amp;gt;&lt;/span&gt; &lt;span style="color:#000"&gt;println&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;$x&lt;/span&gt;&lt;span style="color:#4e9a06"&gt; is a String&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;else&lt;/span&gt; &lt;span style="color:#ce5c00;font-weight:bold"&gt;-&amp;gt;&lt;/span&gt; &lt;span style="color:#000"&gt;println&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;$x&lt;/span&gt;&lt;span style="color:#4e9a06"&gt; is not Int,Double or String&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#000;font-weight:bold"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Creating a Class() example in Kotlin</title><link>https://www.siberoloji.com/creating-a-class-example-in-kotlin/</link><pubDate>Mon, 28 Feb 2022 00:00:00 +0000</pubDate><guid>https://www.siberoloji.com/creating-a-class-example-in-kotlin/</guid><description>&lt;p&gt;In Object-Oriented Programming Languages, the classes are important. You can find a simple Class creating example in this post.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-kotlin" data-lang="kotlin"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;fun&lt;/span&gt; &lt;span style="color:#000"&gt;main&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;()&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;var&lt;/span&gt; &lt;span style="color:#000"&gt;personA&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;=&lt;/span&gt; &lt;span style="color:#000"&gt;Person&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;Mike&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;Sunshine&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;var&lt;/span&gt; &lt;span style="color:#000"&gt;personB&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;=&lt;/span&gt; &lt;span style="color:#000"&gt;Person&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;var&lt;/span&gt; &lt;span style="color:#000"&gt;personC&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;=&lt;/span&gt; &lt;span style="color:#000"&gt;Person&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#000"&gt;lastName&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;=&lt;/span&gt; &lt;span style="color:#4e9a06"&gt;&amp;#34;Peterson&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000;font-weight:bold"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#204a87;font-weight:bold"&gt;class&lt;/span&gt; &lt;span style="color:#000"&gt;Person&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#000"&gt;firstName&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt;&lt;span style="color:#000"&gt;String&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;=&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;John&amp;#34;&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;,&lt;/span&gt; &lt;span style="color:#000"&gt;lastName&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt;&lt;span style="color:#000"&gt;String&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;=&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;Doe&amp;#34;&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;init&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#000"&gt;println&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;(&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;A new person object created with First Name: &lt;/span&gt;&lt;span style="color:#4e9a06"&gt;$firstName&lt;/span&gt;&lt;span style="color:#4e9a06"&gt; and &amp;#34;&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;+&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#4e9a06"&gt;&amp;#34;Last Name: &lt;/span&gt;&lt;span style="color:#4e9a06"&gt;$lastName&lt;/span&gt;&lt;span style="color:#4e9a06"&gt;&amp;#34;&lt;/span&gt; &lt;span style="color:#000;font-weight:bold"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#000;font-weight:bold"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000;font-weight:bold"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-kotlin" data-lang="kotlin"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000"&gt;A&lt;/span&gt; &lt;span style="color:#000"&gt;new&lt;/span&gt; &lt;span style="color:#000"&gt;person&lt;/span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;object&lt;/span&gt; &lt;span style="color:#000"&gt;created&lt;/span&gt; &lt;span style="color:#000"&gt;with&lt;/span&gt; &lt;span style="color:#000"&gt;First&lt;/span&gt; &lt;span style="color:#000"&gt;Name&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt; &lt;span style="color:#000"&gt;Mike&lt;/span&gt; &lt;span style="color:#000"&gt;and&lt;/span&gt; &lt;span style="color:#000"&gt;Last&lt;/span&gt; &lt;span style="color:#000"&gt;Name&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt; &lt;span style="color:#000"&gt;Sunshine&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000"&gt;A&lt;/span&gt; &lt;span style="color:#000"&gt;new&lt;/span&gt; &lt;span style="color:#000"&gt;person&lt;/span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;object&lt;/span&gt; &lt;span style="color:#000"&gt;created&lt;/span&gt; &lt;span style="color:#000"&gt;with&lt;/span&gt; &lt;span style="color:#000"&gt;First&lt;/span&gt; &lt;span style="color:#000"&gt;Name&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt; &lt;span style="color:#000"&gt;John&lt;/span&gt; &lt;span style="color:#000"&gt;and&lt;/span&gt; &lt;span style="color:#000"&gt;Last&lt;/span&gt; &lt;span style="color:#000"&gt;Name&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt; &lt;span style="color:#000"&gt;Doe&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000"&gt;A&lt;/span&gt; &lt;span style="color:#000"&gt;new&lt;/span&gt; &lt;span style="color:#000"&gt;person&lt;/span&gt; &lt;span style="color:#204a87;font-weight:bold"&gt;object&lt;/span&gt; &lt;span style="color:#000"&gt;created&lt;/span&gt; &lt;span style="color:#000"&gt;with&lt;/span&gt; &lt;span style="color:#000"&gt;First&lt;/span&gt; &lt;span style="color:#000"&gt;Name&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt; &lt;span style="color:#000"&gt;John&lt;/span&gt; &lt;span style="color:#000"&gt;and&lt;/span&gt; &lt;span style="color:#000"&gt;Last&lt;/span&gt; &lt;span style="color:#000"&gt;Name&lt;/span&gt;&lt;span style="color:#000;font-weight:bold"&gt;:&lt;/span&gt; &lt;span style="color:#000"&gt;Peterson&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#000"&gt;Process&lt;/span&gt; &lt;span style="color:#000"&gt;finished&lt;/span&gt; &lt;span style="color:#000"&gt;with&lt;/span&gt; &lt;span style="color:#000"&gt;exit&lt;/span&gt; &lt;span style="color:#000"&gt;code&lt;/span&gt; &lt;span style="color:#0000cf;font-weight:bold"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item></channel></rss>