skip to main
|
skip to sidebar
Andy's Scala notes
Saturday, 25 April 2009
Scala - how to cast
How to cast a list of one type to something else in Scala:
def casting(params: List[Object]) {
val strParams = params.map { _.asInstanceOf[String] }
println(strParams)
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Nuclear Carrot - Andy's website
Labels
actors
(1)
anonymous type
(1)
cast
(1)
functions
(5)
implicits
(1)
instanceOf
(1)
lift
(1)
links
(2)
list
(4)
loop
(3)
map
(1)
option[T]
(1)
string
(2)
tuples
(1)
xml
(1)
No comments:
Post a Comment