energyjtw
12-14-2011, 02:35 AM
I have a simple project that is getting me stuck. The current submission is included. The question is:
Write a class named Acc2 containing:
An instance variable named sum of type integer, initialized to 0.
A method named getSum that returns the value of sum .
This is my current sumbission:
public class Acc2
{
private int sum = 0;
public int getSum (){method sum;}
}
The system says that the only thing wrong with it is the bold word method. I have tryed many things in place of it however I am unable to move on.
Write a class named Acc2 containing:
An instance variable named sum of type integer, initialized to 0.
A method named getSum that returns the value of sum .
This is my current sumbission:
public class Acc2
{
private int sum = 0;
public int getSum (){method sum;}
}
The system says that the only thing wrong with it is the bold word method. I have tryed many things in place of it however I am unable to move on.