How I can cast a variable in Scala?

Ads
 

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 can I do it? .click();
Advertisements
How can I learn Java?
how should i can solve
How can we destroy the session, how can we unset the variable of a session?
how can i add hibernate plugin to eclipse?
how i can get jqfade.js library
how can i make monthly register ?
how can i remove newline characters and tabs
how can i create a discussion forum?
How can I to my database to my application
how can i display a editable result of form?
how can i display a pdf file in a jtextarea
How can I protect my database password ?
How can i modify my account in roseindia
How can I create sessionfactory in Hibernate?
How can i use Facebook connect button
how can i close a frame. - Java Beginners
I don't know how to use counter variable in this Qustion ....:(
How can I show users privileges in MySQL?
how can i print the selected content of a frame
How I get a variable from java script to use it in the scriptlet of jsp.
How can I change UIButton title color?
How to extend spring entity objects and be able to cast.
how can i simplify my java code
how can i set an object in focus
How can i search and insert within a query
how can i hide and show tables
how can I great two user and password in C++?
Can i use Scriptlets inside javascript,if so how?
What is the default session time in php and how can I change it?

Ads