blob: 7749671019ea1101566c0c656f1cbfcb83db5096 (
plain) (
tree)
|
|
class B(member: Int) extends SubA(member)
object Test {
def printFields(cls: Class[_]) =
println(cls.getDeclaredFields.map(_.toString).sorted.deep.mkString("\n"))
def main(args: Array[String]): Unit = {
val a = new A(10)
val subA = new SubA(11)
val b = new B(12)
println("# Fields in A:")
printFields(classOf[A])
println("# Fields in SubA:")
printFields(classOf[SubA])
println("# Fields in B:")
printFields(classOf[B])
}
}
|