Questions

  1. Describe a case where an implicit parameter is also an implicit conversion.
  2. Replace the following definition that uses view bounds with one using context bounds: def compare[T <% Comparable[T]](x: T, y: T) = x < y?
  3. Why are type classes sometimes said to separate behavior and data?
  4. It is easy to change the example of possible conflicts in lexical scope so that one of the implicits wins over others and so that all others can be uncommented without having conflicts anymore. Can you change this?
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.163.13