Hi, I need to create a huge array of (up to 160,000) points on a grid ex. (4, 23). First of all, I have no idea how to create an array, I looked on the Java API, but I was helplessly and hopelessly confused. And after a create the array, i need to be able to add more points to it, and check new points against old points to avoid repetition....
llemes4011
31
Posting Whiz in Training
Recommended Answers
Jump to Post160,000 elements in an array can be memory-expensive... so let's try to find a way to make things less expensive.
First of all, what is the range of your points (what are they for, and what is the maximum number you're planning on using per coordinate)?
If the …
Jump to PostHere's an example--
public class Square{ public short x = 0, y = 0; public Square(short x, short y){ this.x = x; this.y = y; } public static void main(String... args){ Square.checkMemBefore(" - free mem before Square array"); Square lotsOfSquares[] = null; try{ lotsOfSquares = new Square[160000]; …
Jump to Post. . . ok... slightly less confused... but how would i add a coordinate point to the array?
From the above example, if you wanted to "add" the points (5, 7) and (8, 9), you could do this:
lotsOfSquares[0] = new Square (5, 7); lotsOfSquares[1] = new …
All 9 Replies
Alex Edwards
321
Posting Shark
llemes4011
31
Posting Whiz in Training
Alex Edwards
321
Posting Shark
llemes4011
31
Posting Whiz in Training
VernonDozier
2,218
Posting Expert
Featured Poster
llemes4011
31
Posting Whiz in Training
Alex Edwards
321
Posting Shark
prateeknigamk
0
Newbie Poster
Alex Edwards
321
Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.