- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Soumak De has Published 84 Articles
Soumak De
196 Views
In this article, we will take an example and demonstrate how we can obtain the class reference in Kotlin. Kotlin does not support fetching the class reference directly, but you can obtain the same reference via extension itself. In the following example, we will see how we can do it ... Read More
Soumak De
530 Views
In this article, we will take an example to demonstrate how we can extend and implement in the same class. In this example, We will be creating an interface and a dummy Parent class.From the Child class, we will extend the Parent class and implement the interface.Example – Extending and ... Read More
Soumak De
955 Views
Result is a Serializable class in Kotlin. The function definition looks like this −class Result : SerializableThis class has two properties − "isFailure" and "isSuccess".As per the documentation, Result cannot be used as a direct return type of Kotlin function. However, in this article, we will see how we can ... Read More
Soumak De
748 Views
In this article, we will take an example and demonstrate the difference between (!!) and (?) in Kotlin.Example – "!!" and "?" operator in KotlinKotlin provides a wonderful operator to check NULL pointer exceptions. It throws a NULL pointer exception instead of breaking the programming logic whenever the variable is ... Read More
Soumak De
264 Views
Exception is an important aspect of any programming language. It prevents our code from generating incorrect output at runtime. There are two types of exceptions −Checked exceptionsUnchecked exceptionsChecked ExceptionsChecked exceptions are those which are checked at the compile time. As per example, FileNotFoundException() or IOException. In the following example, we ... Read More
Soumak De
2K+ Views
Data class is a collection in Kotlin to store data. Logically this is same as creating a Java POJO class. In Java, we do create extra member functions to set and get the data in the member variables. In Kotlin, we don’t need to create separate methods to access the ... Read More
Soumak De
3K+ Views
Kotlin supports delegation of design pattern by introducing a new keyword "by". Using this keyword or delegation methodology, Kotlin allows the derived class to access all the implemented public methods of an interface through a specific object.ExampleIn this example, we will implement an abstract method of a Base class from ... Read More
Soumak De
861 Views
"Out" keyword is extensively used in Kotlin generics. Its signature looks like this −ListWhen a type parameter T of a class C is declared out, then C can safely be a super type of C. That means, a Number type List can contain double, integer type list.ExampleThe following example demonstrates how ... Read More
Soumak De
2K+ Views
In this article, we will see how we can read a text file using Kotlin library functions. Kotlin is based on Java, hence we can use different Java library functions in Kotlin too.Example - BufferedReaderGo ahead and create a Kotlin file in your workspace and name it " ReadFile.kt". Keep ... Read More
Soumak De
511 Views
Elvis operator is very common in many programming languages. This is a binary expression that returns the first operand when the expression value is True and it returns the second operand when the expression value is False. Generally, the Elvis operator is denoted using "?:", the syntax looks like −First ... Read More