can somebody plz..help me with this error, im really new in java and i need lots of help plsss..
[code]
import java.io.*;
class Students implements Comparable
{
private String firstName, lastName;
private int credits;
private double gradePointAverage;
private boolean nullStudent = false;
// The exception thrown for names without a space
// separating the first name and last name
public class NameFormatError extends IOException {}
lastName has private access in Student
firstName has private access in Student
name1 has private access in Student
name2 has private access in Student
cannot find symbol varibale name1
cannot find symboll variable name2
plz help
thanks
02-19-2006, 10:58 PM
mnuttall
lastName has private access in Student
firstName has private access in Student
Use an accessor (get) or change the visiblity to something other than private
name1 has private access in Student
name2 has private access in Student
cannot find symbol varibale name1
cannot find symboll variable name2
These are declared locally. If you need to refer to them give them class scope. But what you are doing in the equals is wrong. Do the same sort of thing you are doing in the compare method.