Casting of int[] to Object[]

Reply

Join Date: Aug 2007
Posts: 9
Reputation: legilimen is an unknown quantity at this point 
Solved Threads: 2
legilimen legilimen is offline Offline
Newbie Poster

Casting of int[] to Object[]

 
0
  #1
22 Days Ago
When i do something like
  1. static int call (Object a){
  2. }
  3.  
  4. main(){
  5. call(10);
  6. }
it works because of autoboxing

But why didn't the language designers support something like this ?

  1. static int call (Object []a){
  2. }
  3.  
  4. main(){
  5. int []a = new int[10];
  6. call(a);
  7. }

Why didn't they support something like this. Went through JLS but couldnt find what i wanted.

Thanks in advance for your time.
Where your treasure is,
there will your heart be also
!!!
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC