标签:
package com.hengheng.scala class AbstractClass { } abstract class People { def speak val name : String var age : Int } class Worker extends People { def speak { println("Hello, Worker!!!") } val name = "Rocky" var age = 27 } object AbstractClass extends App { val worker = new Worker worker.speak println(worker.name + ":" + worker.age) }
输出:
Hello, Worker!!!
Rocky:27
标签:
原文地址:http://www.cnblogs.com/aguncn/p/4457336.html