How I can cast a variable in Scala?

How I can cast a variable in Scala?

Hi,

Trying Big Data and now I want to learn to cast variables.

Thanks

View Answers

November 12, 2017 at 7:21 PM

Hi,

Suppose you have an object of Graphics and you wan to cast it to Graphics2D then you can use following code:

g.asInstanceOf[Graphics2D];

Similarly you can apply this logic to all other classes in SCALA.

Thanks

Ads









Related Tutorials/Questions & Answers:
How I can cast a variable in Scala?
How I can cast a variable in Scala?
Advertisements
How do I read a variable from a file in shell script
I don't know how to use counter variable in this Qustion ....:(
How I get a variable from java script to use it in the scriptlet of jsp.
How can I do it? .click();
How can I learn Java?
how should i can solve
ModuleNotFoundError: No module named 'scalar'
how can i display a pdf file in a jtextarea
how can i add hibernate plugin to eclipse?
how i can get jqfade.js library
how can i remove newline characters and tabs
how can i make monthly register ?
how can i display a editable result of form?
how can i create a discussion forum?
How can I learn Java in 5 minutes
How can i modify my account in roseindia
How can I master Java in one month?
how can i print the selected content of a frame
How to extend spring entity objects and be able to cast.
How can i use Facebook connect button
How can I create sessionfactory in Hibernate?
How can I start big data?
How can I get IBM certification for free?
How can I practice big data at home?
How can I become a data scientist for free?
How can I become a good data scientist?
How can I get into big data?
How can I learn Hadoop easily?
How can I do data science course?

Ads