Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Scala
Posted by: Pahay Ragh
Added: Oct 25, 2020 3:27 AM
Views: 6
Tags: no tags
  1. //    Implicit parameters
  2.     implicit val int:Int = 42
  3.  
  4.     def strImplicit(implicit integer:Int):String = {
  5.       s"$integer is implicitly passed into function"
  6.     }
  7.  
  8.     println(strImplicit)  // 42 is implicitly passed into function