Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object Array

 
Muhammad usman shad
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15482
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "setting bounds for objects"?

Read Sun's tutorial about arrays to learn more about using arrays in Java.
 
Muhammad usman shad
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic