Can i run a scala class in IntelliJ idea?

I want to run following program in intelliJ . I am able to run scala object but not scala class. Can i run scala Class in IntelliJ?


package com.learning.scala.oops

class learnClass {

private var count = 0
def inc(){ count = count + 1}

def curr(){count}


val a = new learnClass

Please sign in to leave a comment.