Please view this classes :
class MainClass(firstName:String) extends GenericClass[(Int,String,Long)](firstName,"David")
class GenericClass[T](str1: String, str2: String)
How scala can implement and map multiple type to single generic type ?
I mean GenericClass only have a Single type named GenericClass[T] but MainClass extends this and implement multiple type GenericClass[(Int,String,Long)]
I learn this code on slick orm :
class Suppliers(tag: Tag) extends Table[(Int, String, String, String, String, String)](tag, "SUPPLIERS") { ... }
can do like this in java language ?
(Int, String, Long)is just tuple syntax. Java has not build-in special syntax for tuples, but you can use special classes, which serve a similar purpose to tuples, likePair<A,B>from javatuples. Nothing then stops you from doing things likeGenericClass<Pair<String, String>>in Java.Record3<Integer, String, Long>.