首页
AI Coding
NEW
沸点
课程
直播
活动
AI刷题
APP
插件
搜索历史
清空
创作者中心
写文章
发沸点
写笔记
写代码
草稿箱
创作灵感
查看更多
会员
登录
注册
九幺笑一笑
掘友等级
91
|
91
一字🦌(互赞互关 不关不赞是孤独的儿子)
获得徽章 0
动态
文章
专栏
沸点
收藏集
关注
作品
赞
1.4K
文章 1.3K
沸点 7
赞
1.4K
返回
|
搜索文章
最新
热门
沟子
object Tools { /* *伴生类 和 伴生对象 1.类和对象的名字是一样的 2.他们在同一个文件夹中 特点:可以访问对方的私有(private)属性 */ class Student()
互关互赞互助
/* 类使属性的集合 Student,构造函数用来创建对象的 辅助构建函数,提供多种创建对象的方式 */ class Student(var name:String,var age:Int) { pr
一头鹿拿个钢管
object magic { val f1:(Int,Int) =>Int =+ val f2:(Int,Int) =>Int=+ def test(fn:(Int,Int)=>Int,x:Int,y
兄弟上课认真一字学
``` object base43 { /* * 函数字面量 * 另一种定义函数的方式 */ // 定义函数的方式一:def def getSum(x: Int, y: Int): Int = { x
兄弟闹他
object practice16 { // 汉诺塔递归实现 // n: 圆盘数量 // a: 起始柱 // b: 辅助柱 // c: 目标柱 def f(n: Int, a: String, b:
卤味
``` object B05 { def sum(n:Int): Int={ if (n==1){ 1 }else{ sum(n-1)+n } } def main(args:Array[String
一字饿
``` object B04 { def greet(name:String,score:Int*):Unit={ var total:Double=0 for(i<-score){ total+=1
兄弟没毛
``` object B03 { def greet():Unit={ println(s"hahahaa~~~") } def main(args:Array[String]):Unit={ gre
参数的定义
``` object untitled { //gender: def greet(name:String="笑一笑",age:Int=91,gender:String="男"):Unit={ pri
兄弟依旧多的不说少的不唠
``` object bo1 { def main(args: Array[String]): Unit = { while(true){ print("请输入要判断的年份(输入0就结束判断):“")
下一页
个人成就
文章被点赞
629
文章被阅读
444
掘力值
740
关注了
99
关注者
71
收藏集
0
关注标签
0
加入于
2025-09-09