Created
July 31, 2016 10:22
-
-
Save HDBandit/528f92192e9299bf8a8c009d44ca753e to your computer and use it in GitHub Desktop.
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
class Rational(n: Int, d: Int) { | |
require(d != 0, "Denominator cannot be 0") | |
println("My rational is created") | |
override def toString = s"$n/$d" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment