当前位置:网站首页>kotlin 继承
kotlin 继承
2022-07-04 18:32:00 【AdleyTales】
open class Student(var name: String, var age: Int) {
open fun say() {
println("name: $name, age: $age, say ------")
}
}
class G2Student(name: String, age: Int, var email : String) : Student(name, age) {
override fun say() {
println("name: $name, age: $age, email: $email, say ------")
}
}
fun main() {
val p =Student("adley", 18)
p.say()
val g2p = G2Student("孙晓辉", 20, "Beijing")
g2p.say()
}
边栏推荐
- 2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions
- Shell programming core technology "four"
- 明明的随机数
- 安徽 中安在线文旅频道推出“跟着小编游安徽”系列融媒体产品
- Wechat reading notes of "work, consumerism and the new poor"
- Pythagorean number law (any three numbers can meet the conditions of Pythagorean theorem)
- Leetcode ransom letter C # answer
- There are multiple divs in the large div, which are displayed on the same line. After overflow, scroll bars are generated without line breaks
- Educational Codeforces Round 22 E. Army Creation
- 《工作、消费主义和新穷人》的微信读书笔记
猜你喜欢

Hough transform Hough transform principle

Online text line fixed length fill tool

92.(cesium篇)cesium楼栋分层

Hough Transform 霍夫变换原理

大div中有多个div,这些div在同一行显示,溢出后产生滚动条而不换行

PointNeXt:通过改进的模型训练和缩放策略审视PointNet++

abc229 总结(区间最长连续字符 图的联通分量计数)

How to use async Awati asynchronous task processing instead of backgroundworker?

Lenovo explains in detail the green smart city digital twin platform for the first time to solve the difficulties of urban dual carbon upgrading
牛客小白月赛7 谁是神箭手
随机推荐
【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
矩阵翻转(数组模拟)
ftp、sftp文件传输
2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions
Niuke Xiaobai monthly race 7 I new Microsoft Office Word document
Oracle with as ORA-00903: invalid table name 多表报错
如何使用Async-Awati异步任務處理代替BackgroundWorker?
Qt实现界面滑动切换效果
1003 emergency (25 points) (PAT class a)
Shell 編程核心技術《四》
黑马程序员-软件测试--07阶段2-linux和数据库-09-24-linux命令学习步骤,通配符,绝对路径,相对路径,文件和目录常用命令,文件内容相关操作,查看日志文件,ping命令使用,
node_exporter部署
Shell 编程核心技术《四》
Hough Transform 霍夫变换原理
Wechat reading notes of "work, consumerism and the new poor"
Shell programming core technology "four"
Introduction to polyfit software
kotlin 基本使用
How test engineers "attack the city" (Part 2)
牛客小白月赛7 E Applese的超能力