|
-
Passing an un-dimensioned array to a method
How do I pass an array to a method, where the method set the dimension and
populates the array. I would like to do something like:
int x[];
changeValue(x);
System.out.Println(""+x[0]);
System.out.Println(""+x[1]);
public void changeValue(int x){
x[]=new int[2];
x[0]=1;
x[1]=2;
}
Similar to the VB way of ReDim an array. Is this at all possible in Java?
Cheers,
Joakim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks