What is this?

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
evgen

What is this?

Post by evgen »

a = (B)(I)b; What happens in this statement and where i can read about it. Thanks. From Russia with love.))

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: What is this?

Post by admin »

A multiple cast is not much different from a single one. You should break a multiple into two single casts as shown below:

b = (B)(I) a;

is same as:

I temp = (I) a;
b = (B) temp;

That's it. There is nothing more to it.

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests