Results 1 to 3 of 3
- 10-13-2012, 09:46 PM #1
Member
- Join Date
- Jul 2012
- Posts
- 93
- Rep Power
- 0
Calling variables from another method
I have created a method that generates three random points that are not collinear and are not on the same points. There are 5 loops which create five sets of three random points. Each set of random points creates a triangle. So there are 5 sets of random points which when connected make five triangles. This Only occurs in one method called GenerateRandomTriangles() {....}. My problem is after creating another method which does some computation to tell what kind of triangle it is such as "Equilateral", it needs to call the variables created in the GenerateRandomTriangles() method for each iteration of the loop so that the values change in both methods as each x and y coordinate change consecutively. I can do all this in one method but my methods are starting to get longer and longer. If someone can explain how this should be done please let me know.
ThanksLast edited by jwl; 10-13-2012 at 09:50 PM.
- 10-16-2012, 04:45 AM #2
Member
- Join Date
- Oct 2012
- Location
- Tempe, Arizona
- Posts
- 77
- Blog Entries
- 12
- Rep Power
- 0
Re: Calling variables from another method
Couldn't you just store the points in an array and then just pass the array to the next method via the parameters?
- 10-17-2012, 08:37 PM #3
Similar Threads
-
calling variables in a loop?
By SnakeDoc in forum New To JavaReplies: 3Last Post: 06-14-2012, 10:54 PM -
Calling Variables in Multiple Methods
By PrimalScientist in forum New To JavaReplies: 10Last Post: 02-07-2012, 10:26 AM -
Calling Variables
By Soulpole in forum New To JavaReplies: 7Last Post: 01-28-2012, 08:26 PM -
Thread problem, calling method in run method
By majk in forum Threads and SynchronizationReplies: 4Last Post: 09-27-2010, 11:40 AM -
Calling a method in a different class from within a method problem
By CirKuT in forum New To JavaReplies: 29Last Post: 09-25-2008, 07:55 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks