Giter VIP home page Giter VIP logo

kusha-b-k / scala-programming Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 4 KB

Scala Programming,Scala is a general-purpose programming language providing support for functional programming and a strong static type system. Designed to be concise, many of Scala's design decisions aimed to address criticisms of Java

scala scala-programming scala-library learning syntax quickstart kushabk b k kush

scala-programming's Introduction

Scala Programming

Learn scala in simple way

List of Scala Keywords

          @
          #
          >:
          <%
          <:
           <-
           =>
           =
           :
           -
    abstract
    case
    catch
    class
    def
    do
    else
    extends
    false
    final
    finally
    for
    forSome
    if
    implicit
    import
    lazy
    match
    new
    Null
    object
    override
    package
    private
    protected
    return
    sealed
    super
    this
    throw
    trait
    Try
    true
    type
    val
    Var
    while
    with
    yield

How to comment in scala

type 1 :

       /** This is a comment in scala defined autor kusha b k **/

type 2 :

     // this line  is comment in scala defined by autor 

How to import package in scala

type 1:

                import kushabk._   //	all members of kushabk       

type 2:

                import kusha.b    //the member b of kusha

type 3:

                import kusha.b.k        

type 4:

                import kusha.{b,k}

How to define mutable variables in scala

1. How to define integer variables in Scala

syntax 1

    var Int_variable_name

Syntax 2

    var Int_variable_name = initialization_value 

examples

 var myIntvalue


 var myIntvalueInit = 100

2. How to define Double variables in Scala

syntax 1

    var double_variable_name

Syntax 2

    var double_variable_name = initialization_value 

examples

 var mydoubletvalue


 var mydoublevalueInit = 100.0

3. How to define Floating variables in Scala

syntax 1

    var float_variable_name

Syntax 2

    var float_variable_name = initialization_value 

examples

 var myfloat


 var myfloatvalueInit = 100.0f

4. How to define String variables in Scala

syntax 1

    var string_variable_name

Syntax 2

    var string_variable_name = "initialization_value" 

examples

 var mystring


 var mystringvalueInit = "Hellow String world by kusha"

5. How to define Character variables in Scala

syntax 1

    var char_variable_name

Syntax 2

    var char_variable_name = 'initialization_value '

examples

 var mychar


 var mycharvalueInit = 'K'

How to print out put in scala

       println("This is my output")

How to Define array in scala

syntax 1:

       var variable_name:Array[array_type] = new Array[array_type] (size_of_array)

example

        var k:Array[String] = new Array[String](10)

Defining The function in scala

    def thisismyfunctionname(myintvariable: Int) = { myintvariable * myintvariable }

scala-programming's People

Contributors

kusha-b-k avatar

Stargazers

 avatar

Watchers

 avatar  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.