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


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: 30138

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: 38100
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: 7553

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?
Articles by Winston can be found here
Ashwani Singh

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?

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
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)