View Single Post
Old 04-19-2006, 04:00 PM   #7 (permalink)
Bunkertor 7
Banned
 
Bunkertor 7's Avatar
 
Join Date: Nov 2004
Location: Georgia
Posts: 281
+0 Internets
Send a message via AIM to Bunkertor 7
Are you trying to make an array of 6 integers with the q[6], because a single variable name with q[x] will cause a compile time error.

The way to define arrays in java is

datatype[] name = new datatype[x], where x is the number of elements you want. I think you want me to create an object that holds a string and an array of 6 integers. The problem is referencing between arrays of different objects (say between Student 1 and Student 3). The code you suggested,

"if (srecords[k].q[choice-1] > srecords[k+1].q[choice-1])"

looks like it would take care of this since I can swap elements between arrays nice and crisp (perhaps there's no real other way to do this in Java) .

I think understand what you're talking about with the object referencing; you're trying to convey that you should only have methods that operate on the object values either through instancing or whatnot.

I see where my error was in my printout method too.

The simple variable names just let me saved time when I was writing out the code, but that's just my preference.

Again, I thank you quite a bit for helping me with this tedious project.
Bunkertor 7 is offline   Reply With Quote

 
Uberguilds Network