|
-
how to invoke an object using an array
Is it possible to use an array to invoke an object?
<pre>
int[][] a1 = {
{ 1, 2, 3, },
{ 2, 2, 3, },
{ 2, 2, 3, },
{ 4, 4, 4, },
};
for(int i = 0; i <=3; i++){
for(int j = 0; j < 3; j++)
System.out.println(a1[i][j]);
}
so, instead of creating 4 objects
obj myobj = new obj(1,2,3);
obj myobj2 = new obj(2,2,3);.....
....
I want to use one object and have the array invoke the object.
</pre>
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