In the following code I am getting the error-' the modifier public is not valid for this item'.Error is showing in 'getAvr'-
I have defined 'getAvr' in a class 'results' which inherits 'student' interface.Code is given below.
Please tell me how to debug the error .
Code:
public interface student
{
public double getAvr(params int[] marks);
void display(double avr);
}
Code:
public class results:student
{
public double getAvr(params int[] marks)
{
double avr = 0;
double tot = 0;
int n;
for (int n = 0; n <= marks.length - 1; n++)
tot += marks(n);
avr = tot / marks.Length;
return avr;
}
}
Please tell me how to debug the error .
Comment