Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Collection Questions

 
Sailendra Jena
Greenhorn
Posts: 9
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose a class name is Employee as below examples

here we passing 1000 of employees name only through the object of this class to an ArrayList list=--------------------.Tell me the answer when i will get the name of all employee from the object of the ArrayList i.e through list object?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Can you please explain more clearly what your question is?

If your Employee class looks exactly like you posted, it's not of much use. You have a private member variable name but there is no way to get or set the value of that member variable.
 
Sailendra Jena
Greenhorn
Posts: 9
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI
My question is that suppose i am entering 1000 employee name through this class which is directly store inside the ArrayList list object just like as Collection API's ArrayList. Similar to that but only difference is that when i am entering through this class it will store to that ArrayList object.So my question is that how i will access that all employee name through this ArrayList object reference.
 
Paul Clapham
Sheriff
Pie
Posts: 20958
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When someone asks you to explain your question more clearly, that doesn't mean to just copy what you said before. On the contrary, it asks you to post something different. Something more understandable. Your question was impossible to understand the first time, and repeating it didn't make it any easier to understand.

I would suggest for a start posting meaningful code. And then asking a meaningful question about that code. So far you haven't done either of those things.

Also it's possible that you can't express yourself in English well enough. You might consider asking somebody with better English skills to help you out if that is true.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15214
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're not familiar with Java collection classes, you can find a very good tutorial here: The Java Tutorials - Collections (this was written by Josh Bloch - he is the one who originally invented and implemented the Java collections API!).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic