• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Collection Questions

 
Greenhorn
Posts: 10
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 10
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!).
 
reply
    Bookmark Topic Watch Topic
  • New Topic