MotaF
MotaF

Reputation: 625

InteliJ IDEA,create a Scala class,proper order

I am learning from Coursera tutorial,but my IDEA is different from the one in the course.This is the screenshot enter image description here

When I try to create class,I got this

enter image description here

What should I change to get object instead of class?

This is how my GUI looks like enter image description here

Upvotes: 0

Views: 40

Answers (2)

prayagupadhyay
prayagupadhyay

Reputation: 31252

When you ask to create a scala class, select the object from dropdown

1) Create scala class

enter image description here

2) Select kind of scala class

enter image description here

but you will have to add main method by yourself, or also can extend App.

object ExampleApp {
  def main(args: Array[String]): Unit = {

  }
}

Upvotes: 3

kromastorm
kromastorm

Reputation: 164

When you open the dialog for new class, do not click "OK" and below the name of file, select dropdown "kind" to select object or traits.

Upvotes: 1

Related Questions