class checkEven(){ def isEven(n: Int) = { if(n%2 == 0) println("Even") else println("Odd") } } object IsEvenClass{ def main(args: Array[String]){ val e1 = new checkEven() println("hello world") e1.isEven(3) } }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more