Originally posted by Jake Miller:
Sorry to bombard this message board with simple questions, but I am teaching myself this and it's really not going too well...
Originally posted by Jake Miller:
Mix4 [] m4a = new Mix4[20]; //Very confused by this one. Declaring arrays, but isn't the name of this class Mix4 also?
Originally posted by Jake Miller:
m4a[x] = new Mix4(); //Again, confused...
Originally posted by Jake Miller:
m4a[x].counter = m4a[x].counter + 1; //Adds 1 to the counter, but how does this relate to the cell in the array?
Originally posted by Jake Miller:
count = count + m4a[x].maybeNew(x); //Something gets added to count, but I'm not entirely sure what...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by Jake Miller:
... This seems to me like a neverending cycle: create class Mix4, method create an array of Mix4s, each Mix4 is a class with the method to create new Mix4s in it...
Originally posted by Jake Miller:
... We declare index to be an int value, right? But we don't set it equal to anything to start with...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Originally posted by marc weber:
In the method maybeNew, "index" is the int value that's passed to the method as a parameter. So when we call the method with maybeNew(x), then "index" is assigned the value of x.
This method is defined as "public int maybeNew(int index)," so it must return an int value.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
|