Author: admin
-
Data Types
In the Go programming language, data types refer to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted. The types in Go can be classified as follows − Sr.No. Types and…
-
Basic Syntax
We discussed the basic structure of a Go program in the previous chapter. Now it will be easy to understand the other basic building blocks of the Go programming language. Tokens in Go A Go program consists of various tokens. A token is either a keyword, an identifier, a constant, a string literal, or a…
-
Strings
The Kotlin String data type is used to store a sequence of characters. String values must be surrounded by double quotes (” “) or triple quote (“”” “””). We have two kinds of string available in Kotlin – one is called Escaped String and another is called Raw String. Example When you run the above Kotlin program, it will generate…
-
Program Structure
Before we study the basic building blocks of Go programming language, let us first discuss the bare minimum structure of Go programs so that we can take it as a reference in subsequent chapters. Hello World Example A Go program basically consists of the following parts − Let us look at a simple code that…
-
Environment Setup
Local Environment Setup If you are still willing to set up your environment for Go programming language, you need the following two software available on your computer − Text Editor You will require a text editor to type your programs. Examples of text editors include Windows Notepad, OS Edit command, Brief, Epsilon, EMACS, and vim…
-
Booleans
Many times we come across a situation where we need to take decision in Yes or No, or may be we can say True or False. To handle such situation Kotlin has a Boolean data type, which can take the values either true or false. Kotlin also has a nullable counterpart Boolean? that can have the null value. Create Boolean Variables A boolean variable can be created using Boolean keyword and this…
-
Overview
Go is a general-purpose language designed with systems programming in mind. It was initially developed at Google in the year 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. It is strongly and statically typed, provides inbuilt support for garbage collection, and supports concurrent programming. Programs are constructed using packages, for efficient management of dependencies.…
-
Operators
An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. Kotlin is rich in built-in operators and provide the following types of operators: Now let’s look into these Kotlin Operators one by one. (a) Kotlin Arithmetic Operators Kotlin arithmetic operators are used to perform basic mathematical operations such as…
-
Debugging Program
A debugger tool is used to search for errors in the programs. A debugger program steps through the code and allows you to examine the values in the variables and other data objects during execution of the program. It loads the source code and you are supposed to run the program within the debugger. Debuggers…
-
Data Types
Kotlin data type is a classification of data which tells the compiler how the programmer intends to use the data. For example, Kotlin data could be numeric, string, boolean etc. Kotlin treats everything as an object which means that we can call member functions and properties on any variable. Kotlin is a statically typed language,…