aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Intersection" Watch "Intersection" New topic


Nemanja Gajic

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

Joined: May 26, 2003
Posts: 29233

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

Joined: Oct 13, 2005
Posts: 36478
Welcome again

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

Joined: Mar 17, 2011
Posts: 7032

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.


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

Joined: May 10, 2013
Posts: 25
Nemanja Gajic wrote:Does anyone know how can I find intersection of 2 objects in Java.
And what can that mean?

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.


List<String> listset=new ArrayList<String>();

String arr[]=new String[3];

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

I agree. Here's the link:
subject: Intersection
Similar Threads
intersection between lines
how to find the common part of two sets ?
Best way to work with interaction of 2D images?
Change color of image
How to find the Intersecting edges of a Polygon and a Line String in Java?(JTS)