Hi I am new to scala and i am trying to execute a scala class from eclipse.
I have created a class and not object.
package classexample
class sample extends App {
def printSample(): Unit = {
println("Sample example")
}
def main(args: Array[String]) {
val v = new sample;
v.printSample()
}
}
Now how do I execute this program.When I execute this this does not give any result.
Am i doing it in wrong way or i am missing something....Thanks for your help
staticand so main is just a normal method. You need object, or to create an instance of the class