CrazySynthax CrazySynthax - 2 months ago 6x
Scala Question

Scala REPL: How to load specific package/class/object?

Let's say I have the following file:

package PackName

class Class1 {
def func11():
def func12():

class Class2 {
def func21():
def func22():

If I want to invoke func11 from Class 1 from REPL, I have to run REPL and call:


Do I have an option to load to REPL the class PackName.Class1 so I won't have to type "PackName.Class1" whenever I invoke a function of this class?

import PackName._  //import all members of the package
import PackName.Class1  // import a specific member
import PackName.{Class1, Class2} //import multiple members