scala

Scala Methods

Scala Methods which covers Methods without arguments,Methods with arguments,Methods with return type.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
object methodEx {
 
  def ad(){
    println("atozknowledge.com")    
  }
 
  def demo(b:String){
    println(b)
  }
 
  def add(v1:Int,v2:Int):Int ={
    v1+v2
  }
  def main(args:Array[String]){
    ad()
    demo("i am demo")
    println(add(1,2))
  }
}

For video click my YouTube channel

Leave a Comment