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 {}

public int compareTo(Object other)
{
Student otherStudent = (Student)other;
String name1 = lastName + firstName;
String name2 = otherStudent.lastName + otherStudent.firstName;
return name1.compareTo(name2);
}

public boolean equals(Comparable other)
{
if (!(other instanceof Student))
return false;
Student o = (Student)other;
return name1.equals(o.name1) && name2.equals(o.name2);
}
public boolean isNull()
{
return nullStudent;
}
public void input(BufferedReader reader) throws IOException
{
String line = reader.readLine();
if (line == null)
{
nullStudent = true;
return;
}
// indexOf() and substring();
{

if (line == null)
return;
int space = line.indexOf(' ');
if (space < 0)
throw new NameFormatError();

firstName = (line.substring(0, space));
int space2 = line.indexOf(' ', space + 1);
lastName = (line.substring(space + 1, space2));
space = line.indexOf(' ', space2 + 1);
credits = Integer.parseInt(line.substring(space2 + 1, space));
gradePointAverage = Double.parseDouble(line.substring(space + 1));

{
System.out.println(firstName + ", " + lastName + " " + credits + " " +
gradePointAverage);
}
}
}
}
[\code]

the error im getting are:

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