Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. Error:(4, 52) value amt is not a member of Bill
  2. def compare(that: Bill): Int = (this.amt - that.amt)
  3.  
  4. import scala.math.Ordered
  5.  
  6. class Bill(amt : Int) extends Ordered[Bill] {
  7. def compare(that: Bill): Int = (this.amt - that.amt)
  8. }
  9.  
  10. object Test extends App {
  11. val one = new Bill(10)
  12. val two = new Bill(20)
  13. println(one < two)
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement