Vaibhav Mojidra (VaibhavMojidra)

VaibhavMojidra

Geek Repo

Company:Deloitte USI

Location:Mumbai

Home Page:https://vaibhavmojidra.github.io/site/

Twitter:@VaibhavMojidra

Github PK Tool:Github PK Tool

Vaibhav Mojidra's repositories

Kotlin---Demo-Exception-Handling

Exception Handling in Kotlin is a mechanism that allows you to handle and recover from errors or unexpected events that may occur during program execution. Kotlin provides a comprehensive set of language constructs for handling exceptions.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Destructuring-Declarations

Kotlin allows you to declare multiple variables at once. This technique is called Destructuring declaration. Destructuring Declarations in Kotlin is a feature that allows you to break down complex data types such as arrays, lists, maps, and objects into individual variables.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Property-Delegation-Vetoable

Delegation Vetoable which allows you to veto changes to a property based on certain conditions. That means it will only allow value to change if the given condition is true while re-assigning.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Property-Delegation-Observable

Observable delegation allows you to observe changes to a property and react to those changes. Basically it will work as changeValueListener.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Property-Delegation-Lazy

In Kotlin, property delegation is a language feature that allows you to delegate the implementation of a property to another object. One type of property delegation is the lazy delegation, which allows you to delay the initialization of a property until it is actually used for the first time.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Delegation

Kotlin supports “delegation” 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. The following example demonstrates how this happens in Kotlin.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Generics

Kotlin Generics are a way of writing reusable code that works with different types. Generics allow you to write code that can be used with any type of data, rather than being limited to a specific type.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Sealed-Class

Sealed classes are useful in scenarios where you have a restricted set of possible values or states for a type, and you want to ensure that all possible values or states are accounted for in your code.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Data-Class

A Kotlin Data Class is used to hold the data only and it does not provide any other functionality apart from holding data.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Extension-Function

In Kotlin, an extension function is a function that can be called as a member function of a class, but is defined outside the class. Extension functions are a powerful feature of Kotlin that allow you to add new functionality to existing classes without having to modify their source code.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Interface

In Kotlin, an interface is a collection of abstract methods, properties, and/or default implementations that define a set of behaviors that can be implemented by classes. It defines a contract between the implementing class and the outside world, specifying the methods that a class must implement.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Abstract-Class

In Kotlin, an abstract class is a class that cannot be instantiated directly, but can be subclassed. It is used to define a common interface for a group of related classes, but without providing a complete implementation.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Overriding

In Kotlin, overriding is the mechanism that allows a subclass to provide its own implementation of a method or property that is already defined in its superclass. This means that the subclass can replace the original implementation with a new one, tailored to its specific needs.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Inheritance

In Kotlin, inheritance is the mechanism that allows a class to inherit properties and behavior from a parent class. The parent class is also known as the superclass or base class, while the class that inherits from it is known as the subclass or derived class.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Secondary-Constructor

In Kotlin, a secondary constructor is a way to define additional initialization logic for a class. Unlike the primary constructor, which is defined in the class header, a secondary constructor is defined inside the body of the class.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Primary-Constructor

In Kotlin, a primary constructor is a way to define the primary initialization logic for a class. It is defined in the class header and is called when an object of the class is created.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Type-Aliases

In Kotlin, type aliases are a way to create a new name for an existing type. They are useful for making code more readable, and for abstracting away the details of a complex type.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Anonymous-Inner-Class

Anonymous inner class is a pretty good concept that makes the life of a programmer very easy. Whenever we are implementing an interface, the concept of anonymous inner block comes into picture. The concept of creating an object of interface using runtime object reference is known as anonymous class.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Inner-Class

When a nested class is marked with a keyword inner, then it will be called as an Inner class. An inner class can be accessed by the data member of the outer class.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Nested-Class

Kotlin nested class is by default static, hence, it can be accessed without creating any object of that class but with the help of . dot operator. Same time we cannot access members of the outer class inside a nested class.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Class-And-Objects

A class is a blueprint for the objects which defines a template to be used to create the required objects. The objects are created from the Kotlin class and they share the common properties and behaviours defined by a class in form of data members (properties) and member functions (behaviours) respectively.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Continue-Keyword

The Kotlin continue statement breaks the loop iteration in between (skips the part next to the continue statement till end of the loop) and continues with the next iteration in the loop.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Break-Keyword

Kotlin break statement is used to come out of a loop once a certain condition is met. This loop could be a for, while or do...while loop.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Do-While-Loop

When Kotlin program reaches the do...while loop, it directly enters the body of the loop and executes the available code before it checks for the given condition. If it finds given condition is true, then it repeats the execution of the loop body and continue as long as the given condition is true.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-While-Loop

Kotlin while loop executes its body continuously as long as the specified condition is true. When Kotlin program reaches the while loop, it checks the given condition, if given condition is true then body of the loop gets executed, otherwise program starts executing code available after the body of the while loop.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-For-Loop

Kotlin for loop iterates through anything that provides an iterator ie. that contains a countable number of values, for example arrays, ranges, maps or any other collection available in Kotlin. Kotlin for loop is equivalent to the foreach loop in languages like C#.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-When

Kotlin when expression is similar to the switch statement in C, C++ and Java. Kotlin when can be used either as an expression or as a statement, simply like a switch statement in Java. If it is used as an expression, the value of the first matching branch becomes the value of the overall expression.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-If-Else

If-else statement contains two blocks of statements. ‘if’ statement is used to execute the block of code when the condition becomes true and ‘else’ statement is used to execute a block of code when the condition becomes false.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Extension-Functions

In Kotlin, extension functions allow developers to add new functionality to existing classes or types without modifying the original source code.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0

Kotlin---Demo-Lambda-Expressions-Or-Functions

Lambda expressions or functions in Kotlin are anonymous functions that can be used to simplify code by allowing functions to be created on-the-fly and passed as arguments to other functions. Lambdas are particularly useful when working with higher-order functions, which take other functions as arguments or return them as results.

Language:KotlinLicense:MITStargazers:0Issues:0Issues:0