• Post Reply Bookmark Topic Watch Topic
  • New Topic

SetE and array  RSS feed

 
Aditya Herlambang
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay let's say I have a public method called:

public Set<E> union(Set<E> other){
}

if say inside that method I have declared an object such as:

Set<E> result = new ArraySet<E>(some int, some int)

how do I access the result array elements??
 
Anton Uwe
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1st it will depend on your definition of your class "ArraySet<E>".
Perhaps you thought about something different?
 
Aditya Herlambang
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I just figure out that I can do that by using data[i]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!