Edited by noel222, 23 February 2012 - 03:30 PM.
4 replies to this topic
#1
Posted 25 January 2012 - 06:38 AM
nevermind
|
|
|
#2
Posted 25 January 2012 - 07:02 AM
noel222 said:
Team.T(chris); Team.T(mark); Team.T(kevin); Team.T(keith);
Here you're trying to call a non-static method 'T' from the static syntax. Also, I don't see where chris, mark, kevin, and keith are declared, so it's difficult to tell what you're doing here.
goals teammate = teammate.get(i); Object goals = teammate.get(i);
This doesn't make sense. It looks like you're trying to declare an object of type 'goals' and then declare an object of type 'Object' also named 'goals'.
You should stick with proper naming conventions. Single-letter variables should never be used except for "throwaway" variables, such as loop iterators. Using non-standard variable and method names only results in unreadable statements such as:
T E = (T) F;
To put it simply, there's a lot wrong that just simply needs to be thrown away and rewritten. Try drawing a flowchart first, then write your code from that. Otherwise, you're likely just to get lost.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid
#3
Posted 25 January 2012 - 07:06 AM
nevermind
Edited by noel222, 23 February 2012 - 03:30 PM.
#4
Posted 25 January 2012 - 07:09 AM
You need to pass them into a method in this class through method parameters if you want to pass them from one class to another like that.
In object oriented programming, instance fields and methods belong to the classes in which they are declared. You must declare interfaces (methods) for yourself if you want your classes to interact and pass data back and forth.
Try starting fresh. Draw diagrams for all your objects, what pieces of data they each hold, and how they should interact with one another (which methods they should call from other objects).
In object oriented programming, instance fields and methods belong to the classes in which they are declared. You must declare interfaces (methods) for yourself if you want your classes to interact and pass data back and forth.
Try starting fresh. Draw diagrams for all your objects, what pieces of data they each hold, and how they should interact with one another (which methods they should call from other objects).
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid
#5
Posted 25 January 2012 - 07:17 AM
Is this the same question: http://forum.codecal...html#post324047
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









