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









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?
ModuleNotFoundError: No module named 'scalar'
how should i can solve
How to extend spring entity objects and be able to cast.
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 we destroy the session, how can we unset the variable of a session?
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 to my database to my application
How can i modify my account in roseindia
How can I protect my database password ?
How can I master Java in one month?
how can i print the selected content of a frame
How can i use Facebook connect button
how can i close a frame. - Java Beginners
How can I create sessionfactory in Hibernate?
I want to store the value of local variable into Global variable
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 good data scientist?
How can I get into big data?
How can I do data science course?
How can I become a data scientist?
How quickly can I learn Python?
How can I teach myself Python?
How can I learn Python fast?
How can I learn Python finance?
How can I learn data science in India?
How can I start data analyst?
How can I become a data scientist for free?
How can I learn Hadoop easily?
How can I become a data scientist in India?
How can I go to ISRO after BSc?
How can I show users privileges in MySQL?
How can I change UIButton title color?
how can i simplify my java code
how can i set an object in focus
How can i search and insert within a query

Ads