-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d4b86f
commit 5ee5d2a
Showing
4 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.betterzhang.learnkotlin.java; | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* Author : Andrew Zhang | ||
* Email : betterzhang.dev@gmail.com | ||
* Time : 2017/06/28 上午 10:00 | ||
* Desc : description | ||
*/ | ||
public class People { | ||
|
||
private String name = null; | ||
|
||
public People(String name) { | ||
this.name = name; | ||
} | ||
|
||
public void sayHello() { | ||
System.out.println("Hello Java"); | ||
} | ||
|
||
public final void sayGood() { | ||
System.out.println("Good"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.betterzhang.learnkotlin.java; | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* Author : Andrew Zhang | ||
* Email : betterzhang.dev@gmail.com | ||
* Time : 2017/06/28 上午 10:02 | ||
* Desc : description | ||
*/ | ||
public final class Student extends People { | ||
|
||
private String school = null; | ||
|
||
public Student(String name, String school) { | ||
super(name); | ||
this.school = school; | ||
} | ||
|
||
@Override | ||
public void sayHello() { | ||
super.sayHello(); | ||
System.out.println("Hello Student"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.betterzhang.learnkotlin.kotlin | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* Author : Andrew Zhang | ||
* Email : betterzhang.dev@gmail.com | ||
* Time : 2017/06/28 上午 10:15 | ||
* Desc : description | ||
*/ | ||
open class People(private var name: String? = null) { | ||
|
||
open fun sayHello() = println("Hello Kotlin") | ||
fun sayGood() = println("Good") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.betterzhang.learnkotlin.kotlin | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* Author : Andrew Zhang | ||
* Email : betterzhang.dev@gmail.com | ||
* Time : 2017/06/28 上午 10:17 | ||
* Desc : description | ||
*/ | ||
class Student(private var school: String? = null, name: String) : People(name) { | ||
|
||
override fun sayHello() { | ||
super.sayHello() | ||
println("Hello Student") | ||
} | ||
|
||
} |