Coder Social home page Coder Social logo

vaibhavmojidra / kotlin---demo-sealed-class Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 31 KB

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.

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

License: MIT License

Kotlin 100.00%
kotlin mojidra sealed-class vaibhav vaibhav-mojidra vaibhavmojidra kotlin-sealed-class

kotlin---demo-sealed-class's Introduction

Kotlin Demo Sealed Class

In Kotlin, a sealed class is a class that can be subclassed, but only within the same file where it is declared. This means that all subclasses of a sealed class must be defined in the same file as the sealed class itself. Sealed classes are useful for representing a restricted hierarchy of classes, where all possible subclasses are known in advance.

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. By using a sealed class, you can define a finite set of subclasses that represent all possible values or states, and ensure that these subclasses are the only ones that can be instantiated.


Vaibhav Mojidra - 1.jpeg

kotlin---demo-sealed-class's People

Contributors

vaibhavmojidra avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.