This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Intersection

 
Nemanja Gajic
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how can I find intersection of 2 objects in Java.
And what can that mean?
Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33697
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

I don't know what that means either. Are they talking about lists by any chance? Is there any more context?
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again

The only thing I ever intersect is two Sets; you can read about Sets in the Java Tutorials.
 
Winston Gutkowski
Bartender
Pie
Posts: 9484
50
Eclipse IDE Hibernate Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:The only thing I ever intersect is two Sets...

Or lines. Could they be lines in a graph, or a display?

Inquiring minds want to know.

Winston
 
Ashwani Singh
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nemanja Gajic wrote:Does anyone know how can I find intersection of 2 objects in Java.
And what can that mean?
Thanks


Two objects might be two sets(it can be an array,arraylist,set,hashmap etc).You need to obtain sets between which you want to find out intersection and can obtain the common values of those sets.

like:

List<String> listset=new ArrayList<String>();
listset.add("abc");
listset.add("dfvgd");
listset.add("sdf");

String arr[]=new String[3];
arr[0]="abc";
arr[1]="bnm";
arr[2]="poi";

now you can take these two objects: listset and arr and can find intersection.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic