This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Intersection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Intersection" Watch "Intersection" New topic
Author

Intersection

Nemanja Gajic
Greenhorn

Joined: Oct 19, 2013
Posts: 1
Does anyone know how can I find intersection of 2 objects in Java.
And what can that mean?
Thanks
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

Welcome to CodeRanch!

I don't know what that means either. Are they talking about lists by any chance? Is there any more context?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38100
    
  22
Welcome again

The only thing I ever intersect is two Sets; you can read about Sets in the Java Tutorials.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7553
    
  18

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

Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
Ashwani Singh
Greenhorn

Joined: May 10, 2013
Posts: 29
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
 
subject: Intersection
 
Similar Threads
Change color of image
Best way to work with interaction of 2D images?
intersection between lines
how to find the common part of two sets ?
How to find the Intersecting edges of a Polygon and a Line String in Java?(JTS)