Skip to content

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

Notifications You must be signed in to change notification settings

kusha-b-k/Scala-programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 

Repository files navigation

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 }

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published