Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env scala -savecompiled
object Main extends App {
def getName(y: Any) = {
val list = y.getClass.toString.split("\\$").map(_.trim).toList
list(list.length - 1)
object x {
val abc = scala.collection.mutable.ArrayBuffer
case class Person (var name: String, var age: Int)
var peter = Person("Peter", 31)
List(x, peter).foreach{ z =>
println(z, getName(z))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.