Last active
June 26, 2019 19:09
-
-
Save dam5s/9dac5f539ab7d21e530aff174471a41d to your computer and use it in GitHub Desktop.
Date factory methods in a Date object.
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
package com.example.application | |
import com.example.dateextensions.Date | |
fun main() { | |
println(Date.tomorrow()) | |
} |
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
package com.example.dateextensions | |
import java.util.Date | |
object Date { | |
fun tomorrow(): java.util.Date { | |
// create java.util.Date instance here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment