Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

King of Men

Typecasting in Java

This topic is 5200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does this consume any resources? In principle, you should just be telling the compiler that the pointer is to be treated as Class X, instead of Object. At runtime, after all, what actually gets stored is just a list of ints, floats, and whatnot. But maybe there are issues I''m not aware of? In short, what are the pros and cons of typecasting? To win one hundred victories in one hundred battles is not the acme of skill. To subdue the enemy without fighting is the acme of skill.

Share this post


Link to post
Share on other sites
Advertisement
Yes, there is a cost to doing typecasts in Java.

For more specific examples you might want to read this article. It''s a little old, but the basics haven''t changed.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!