This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SetE and array  RSS feed

 
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??
 
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]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!