Skip to content

Instantly share code, notes, and snippets.

@dam5s
Last active June 26, 2019 19:09
Show Gist options
  • Save dam5s/9dac5f539ab7d21e530aff174471a41d to your computer and use it in GitHub Desktop.
Save dam5s/9dac5f539ab7d21e530aff174471a41d to your computer and use it in GitHub Desktop.
Date factory methods in a Date object.
package com.example.application
import com.example.dateextensions.Date
fun main() {
println(Date.tomorrow())
}
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