Skip to content

Commit 15238f3

Browse files
committed
new vul
1 parent 7646c04 commit 15238f3

50 files changed

Lines changed: 217 additions & 17 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.DS_Store‎

0 Bytes
Binary file not shown.

‎JavaSecurity/.DS_Store‎

0 Bytes
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package LazyList
2+
3+
class Person extends Serializable{
4+
5+
6+
7+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package LazyList
2+
3+
class Serialize {
4+
5+
6+
}

‎JavaSecurity/JDK/Scala1/src/main/scala/Match.scala‎

Lines changed: 0 additions & 17 deletions
This file was deleted.

JavaSecurity/JDK/Scala1/src/main/scala/HelloWorld.scala renamed to JavaSecurity/JDK/Scala1/src/main/scala/basiCode/basic/HelloWorld.scala

File renamed without changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package basiCode;object Match {
2+
def show(result:String):Unit={
3+
println(result)
4+
}
5+
def main(args: Array[String]): Unit = {
6+
val x=11
7+
val y=x match {
8+
case 1 => "one"
9+
case 2 => "two"
10+
case other => s"other: $other" // other是一个变量名,它会接收除了1和2以外的任何值
11+
case _ => s"other: _"
12+
}
13+
show(y)
14+
//other: 11
15+
16+
}
17+
}

JavaSecurity/JDK/Scala1/src/main/scala/Person.scala renamed to JavaSecurity/JDK/Scala1/src/main/scala/basiCode/basic/Person.scala

File renamed without changes.

JavaSecurity/JDK/Scala1/src/main/scala/apply.scala renamed to JavaSecurity/JDK/Scala1/src/main/scala/basiCode/basic/apply.scala

File renamed without changes.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package basiCode.self_type
2+
3+
4+
object Cat {
5+
6+
class Cat {
7+
val name: String = "Tom"
8+
val color: String = "Gray"
9+
10+
def meow(): Unit = println("Meow!")
11+
12+
}
13+
trait Talkative {
14+
def talk(): Unit
15+
}
16+
17+
trait Singer {
18+
self: Talkative => // 声明自身类型,表示Singer依赖于Talkative
19+
def sing(): Unit = {
20+
talk() // 可以直接使用Talkative的成员
21+
println("La la la...")
22+
}
23+
}
24+
25+
trait Dancer {
26+
self: Singer => // 声明自身类型,表示Dancer依赖于Singer
27+
def dance(): Unit = {
28+
sing() // 可以直接使用Singer的成员
29+
println("Shake shake shake...")
30+
}
31+
}
32+
33+
def main(args: Array[String]): Unit = {
34+
val tom = new Cat with Talkative with Singer with Dancer {
35+
override def talk(): Unit = {
36+
println("test")
37+
}
38+
} // 创建一个会说话、唱歌、跳舞的猫
39+
tom.talk() // 输出:Meow!
40+
tom.sing() // 输出:Meow! La la la...
41+
tom.dance() // 输出:Meow! La la la... Shake shake shake...
42+
}
43+
44+
}

0 commit comments

Comments
 (0)