-
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.
update JavaExample and KotlinExample
- Loading branch information
1 parent
a0424de
commit 9cbde92
Showing
6 changed files
with
115 additions
and
1 deletion.
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
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,20 @@ | ||
package com.betterzhang.learnkotlin.java; | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* Author : Andrew Zhang | ||
* Email : betterzhang.dev@gmail.com | ||
* Time : 2017/06/27 下午 5:09 | ||
* Desc : description | ||
*/ | ||
public class Manager { | ||
|
||
private Manager() { | ||
|
||
} | ||
|
||
public static Manager getInstance() { | ||
return new Manager(); | ||
} | ||
|
||
} |
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,24 @@ | ||
package com.betterzhang.learnkotlin.java; | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* Author : Andrew Zhang | ||
* Email : betterzhang.dev@gmail.com | ||
* Time : 2017/06/27 下午 5:05 | ||
* Desc : description | ||
*/ | ||
public final class Person { | ||
|
||
private String name = null; | ||
private int age = 25; | ||
|
||
private Person() { | ||
|
||
} | ||
|
||
public Person(String name, int age) { | ||
this.name = name; | ||
this.age = age; | ||
} | ||
|
||
} |
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
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,16 @@ | ||
package com.betterzhang.learnkotlin.kotlin | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* Author : Andrew Zhang | ||
* Email : betterzhang.dev@gmail.com | ||
* Time : 2017/06/27 下午 5:10 | ||
* Desc : description | ||
*/ | ||
class Manager private constructor() { | ||
|
||
companion object { | ||
fun getInstance(): Manager = Manager() | ||
} | ||
|
||
} |
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,20 @@ | ||
package com.betterzhang.learnkotlin.kotlin | ||
|
||
/** | ||
* Created by IntelliJ IDEA. | ||
* Author : Andrew Zhang | ||
* Email : betterzhang.dev@gmail.com | ||
* Time : 2017/06/27 下午 5:06 | ||
* Desc : description | ||
*/ | ||
class Person private constructor() { | ||
|
||
private var name: String? = null | ||
private var age: Int = 25 | ||
|
||
constructor(name: String, age: Int): this() { | ||
this.name = name | ||
this.age = age | ||
} | ||
|
||
} |