aspose file tools*
The moose likes Beginning Java and the fly likes Object Array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Object Array" Watch "Object Array" New topic
Author

Object Array

Muhammad usman shad
Ranch Hand

Joined: Jan 06, 2010
Posts: 30
Can we make an array of objects of the same class say jtextfield or etc?
If yes then how???
If no then why???
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18666
    
    8

Sure you can.

Of course the elements of the array are initially null, so you would want to assign a JTextField object to each element, but that's how you declare it. Which was your question, wasn't it?
Muhammad usman shad
Ranch Hand

Joined: Jan 06, 2010
Posts: 30
Thanks for updating my knowledge...
But how can we set bounds for objects say for obect 1,2,3 and so on...

Can you code it here???
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14270
    
  21

What do you mean by "setting bounds for objects"?

Read Sun's tutorial about arrays to learn more about using arrays in Java.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Muhammad usman shad
Ranch Hand

Joined: Jan 06, 2010
Posts: 30
Dear Jesper...
I did what i want...
I did not know about how and can we make an array of tha objects...
You told me that...

Thanks alot...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Object Array