# Thread: How Object array will be converted to integer array in the following example

1. Member
Join Date
Aug 2013
Posts
3
Rep Power
0

## How Object array will be converted to integer array in the following example

public static void main(String[] args) {
Object obj = new int[] { 1, 2, 3 };
int[] someArray = (int[])obj;
for (int i : someArray) System.out.print(i + " ");
}

Result here is 1 2 3

2. ## Re: How Object array will be converted to integer array in the following example

Do you have a question?

3. Member
Join Date
Aug 2013
Posts
3
Rep Power
0

## Re: How Object array will be converted to integer array in the following example

I cant get you Kevin

4. Just a guy
Join Date
Jun 2013
Location
Netherlands
Posts
2,610
Rep Power
3

## Re: How Object array will be converted to integer array in the following example

Why did you make this thread?

5. ## Re: How Object array will be converted to integer array in the following example

Suppose you're pointing at an animal but you don't know what it is; you go "hey, an animal!". I pass by and tell you it's an aardvark. All of a sudden you're pointing at an aardvark. Did the animal convert to an aardvark? No, it was an aardvark already. Read 'object' for 'animal' and 'int[]' for 'aardvark' and you get the picture ...

kind regards,

Jos

6. Just a guy
Join Date
Jun 2013
Location
Netherlands
Posts
2,610
Rep Power
3

## Re: How Object array will be converted to integer array in the following example

Ah, I see Jos has dusted off his crystal ball. I demand you tell me the jackpot lottery number (staatsloterij) for next month!

7. ## Re: How Object array will be converted to integer array in the following example

Originally Posted by gimbal2
Ah, I see Jos has dusted off his crystal ball. I demand you tell me the jackpot lottery number (staatsloterij) for next month!
I don't know, I only know things about aardvarks ...

kindest regards,

Jos ;-)

8. ## Re: How Object array will be converted to integer array in the following example

Ethel the aardvark goes quantity surveying!

9. ## Re: How Object array will be converted to integer array in the following example

Originally Posted by JosAH
I don't know, I only know things about aardvarks ...
Commendable modesty, but we all know you're the world's leading expert on elderberries and hamsters.

db

10. Just a guy
Join Date
Jun 2013
Location
Netherlands
Posts
2,610
Rep Power
3

## Re: How Object array will be converted to integer array in the following example

Originally Posted by JosAH
I don't know, I only know things about aardvarks ...
Lies, you just want to keep it all for yourself. I won't forget this sir, the next time you have an opinion I am going to go ahead and disagree with it by default. Puh!

11. ## Re: How Object array will be converted to integer array in the following example

Originally Posted by gimbal2
Lies, you just want to keep it all for yourself. I won't forget this sir, the next time you have an opinion I am going to go ahead and disagree with it by default. Puh!
Me, being the founding father of the SFROPAAFGB(WTCT) (Society For Rehabilitation Of Poor Aardvarks And Free Grolsch Beer (With The Ceramic Top) wiggle my genitals in your general direction, so there! :-P

kindest regards,

Jos ;-)

12. Just a guy
Join Date
Jun 2013
Location
Netherlands
Posts
2,610
Rep Power
3

## Re: How Object array will be converted to integer array in the following example

Curses! I am foiled!

13. ## Re: How Object array will be converted to integer array in the following example

Originally Posted by gimbal2
Curses! I am foiled!
<diabolical laughter>Hahahahaaaa!<diabolical laughter/> now confess you old woman that you didn't expect the SFROPAAFGB(WTCT; as a matter of fact, noone expects the SFROPAAFGB(WTCT!

kind regards,

Jos (<--- poking around with soft cushions)

14. Just a guy
Join Date
Jun 2013
Location
Netherlands
Posts
2,610
Rep Power
3

## Re: How Object array will be converted to integer array in the following example

That just got into a whole different level of weird. I think you've been sampling the Amstel and there are now toxic bubbles in your brain.

15. ## Re: How Object array will be converted to integer array in the following example

Originally Posted by gimbal2
That just got into a whole different level of weird. I think you've been sampling the Amstel and there are now toxic bubbles in your brain.
Don't be silly; the moment they find me sampling Amstel I deserve to be shot in the head in a merciful way. (for the foreigners among us: the Amstel is a polluted little river; you can't brew beer out of it).

kindest regards,

Jos ;-)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•