944,124 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 302
  • Java RSS
Nov 3rd, 2009
0

Casting of int[] to Object[]

Expand Post »
When i do something like
Java Syntax (Toggle Plain Text)
  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 ?

Java Syntax (Toggle Plain Text)
  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.
Reputation Points: 10
Solved Threads: 2
Newbie Poster
legilimen is offline Offline
9 posts
since Aug 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Pseduocode help - extracting parts of a real number
Next Thread in Java Forum Timeline: How to use Binary Search Tree with String? Is there any ready code?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC