I want to call a method of an abstract class in my own class. The abstract class is:
public abstract class Call {
public Connection getEarliestConnection() {
Connection earliest = null;
...
return earliest;
}
}
I want to call the above method, and the calling class is:
public class MyActivity extends Activity {
Connection c = new Connection();
private void getCallFailedString(Call cal)
{
c = cal.getEarliestConnection();
if (c == null) {
System.out.println("** no connection**");
} else {
System.out.println("** connection");
}
}
}
Whenever I try to run the above class, it throws a NullPointerException on the line c = cal.getEarliestConn