Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the colon in the type parameter of a scala class

I know when a class is parameterized, it could be declared as

class A[T]

I see declaration of RDD of Spark begins with:

abstract class RDD[T: ClassTag]

I don't know what does the : ClassTag mean.

like image 415
user2018791 Avatar asked Jul 11 '14 05:07

user2018791


1 Answers

This is a syntactic variant for writing

abstract class RDD[T](implicit context: ClassTag[T])

The comments to this question already link to two related questions that explain what this so-called 'context bound' is about.

like image 117
0__ Avatar answered Nov 15 '22 06:11

0__