Yeah the only times it "does work" is when you try setting the same value. Because you code does nothing it seems like it works. Post 17 gave you a BIG HINT.
Type: Posts; User: Junky
Yeah the only times it "does work" is when you try setting the same value. Because you code does nothing it seems like it works. Post 17 gave you a BIG HINT.
No it doesn't!
--- Update ---
public class TestStudent
{
public static void main(String[] args)
Try calling setQuiz before getQuiz and then tell us if it works.
By that i mean use this line instead of your commented out one:
k.setQuiz(1, 50);
Then look at your code and see what variable is being assigned to what. BIG HINT:
grade = qz1 is wrong. What is the only other possibility?
No it's not. Test your code, print out variables to see what values they have before and after something happens.
Take a close look at your setQuiz method. If you pass in 5 as the grade parameter, what happens to that value?
The getQuiz method is simply the reverse of setQuiz (providing you get the logic...
What happened when you tried?
If you cannot use any sort of data structure then your only option would be a long if statement.