public class LawClient extends Client
{
boolean defendant;
String caseTopic;
LawClient (String n, boolean d)
{
name = n;
defendant = d;
}
LawClient (String n, boolean d, String c, String e)
{
name = n;
defendant = d;
caseTopic = c;
email = e;
}
public String determineStatus()
{
if(caseTopic == null)
{
return "none";
}
else
{
String s = "";
s += "defendant: " + defendant +"\n" + "CaseTopic: " + caseTopic;
return s;
}
}
}
对于 lawclient 构造函数没有合适的构造函数,我得到 2 个错误,但不知道我做错了什么或如何修复它。
这是超级类,因此您可以运行它或查看它。
abstract class Client
{
protected String name;
protected double balance;
protected String email;
Client (String n)
{
name = n;
}
Client (String n, String e)
{
name = n;
email = e;
}
public String getName()
{
return name;
}
public double getBalance()
{
return balance;
}
public String getEmail()
{
return email;
}
public String setName(String a)
{
name = a;
return name;
}
public double adjustBalance(double b)
{
balance = b;
return balance;
}
public String setEmail(String e)
{
email = e;
return email;
}
public abstract String determineStatus();
public String toString()
{
String a = "";
a += "name: " +name + ("\n")+"Balance: " +balance + ("\n")+"Email: " +email + ("\n");
return a;
}
}