cannot resolve symbol
Posted: Jun 28, 2002 8:55 AM
Advertisement
when I try to compile a java program Test.java I get the following error: [parsing started Test.java] [parsing completed 253ms] [loading /usr/j2se/jre/lib/rt.jar(java/lang/Object.class)] [loading /usr/j2se/jre/lib/rt.jar(java/lang/String.class)] [checking Test] [loading ./PsidCustomerUsage.class] [loading ./CustomerUsage.class] Test.java:20: cannot resolve symbol symbol : constructor PsidCustomerUsage (java.lang.String,double,double,double, double,double,double,double,double,doub le,double,double,double,java.lang.String, java.lang.String) location: class PsidCustomerUsage new PsidCustomerUsage(phn,1.00,2.00,3.00,4.00,5.00,6.00,7.00,8.00,9.00,10.00, ^ [to tal 4759ms] 1 error The program Test.java:
import java.io.*;
import java.util.*;
import java.text.*;
import java.net.*;
import java.sql.*;
import java.lang.*;
public class Test {
public static void main(String args[]) {
String phn = "1234567890" ;
String desc = "S" ;
String psidno = "01" ;
PsidCustomerUsage aPsidCustomerUsage;
aPsidCustomerUsage=
new PsidCustomerUsage(phn,1.00,2.00,3.00,4.00,5.00,6.00,7.00,8.00,9.00,10.00,
11.00,12.00,desc,psidno);
}
}
The program PsidCustomerUsage.javaimport java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
public class PsidCustomerUsage extends CustomerUsage
{
public Double psidPkCalls;
public Double psidPkMins;
public Double psidOpkCalls;
public Double psidOPkMins;
public String psidDescription;
public String psidNo;
// constructor method
public PsidCustomerUsage(String newPhone, Double newMthFee, Double newNrc,
Double newPkMins, Double newOpkMins, Double newAir,
Double newRoamChg, Double newRoamMin, Double newNoMo,
Double newPsidPkCalls, Double newPsidPkMins,
Double newPsidOPkCalls, Double newPsidOPkMins,
String newpsidDescription, String newpsidNo)
{
super (newPhone, newMthFee, newNrc, newPkMins, newOpkMins, newAir,
newRoamChg, newRoamMin, newNoMo);
psidPkCalls = newPsidPkCalls;
psidPkMins = newPsidPkMins;
psidOpkCalls = newPsidOPkCalls;
psidOPkMins = newPsidOPkMins;
psidDescription = newpsidDescription;
psidNo = newpsidNo;
}
public Double getPsidPkCalls ()
{ return psidPkCalls; }
public Double getPsidPkMins ()
{ return psidPkMins; }
public Double getPsidOPkCalls ()
{ return psidOpkCalls; }
public Double getPsidOPkMins ()
{ return psidOPkMins; }
public String getPsidDescription ()
{ return psidDescription; }
public String getPsidNo ()
{ return psidNo; }
}
The program CustomerUsage.java:public abstract class CustomerUsage
{
// CustomerUsage attribute definitions...
public String phone;
public Double mth_fee;
public Double nrc;
public Double pk_mins;
public Double opk_mins;
public Double air_chgs;
public Double roam_chgs;
public Double roam_mins;
public Double no_months;
// Constructor method to create an instance
public CustomerUsage(String newPhone, Double newMthFee, Double newNrc,
Double newPkMins, Double newOpkMins, Double newAir,
Double newRoamChg, Double newRoamMin, Double newNoMo)
{
phone = newPhone;
mth_fee = newMthFee;
nrc = newNrc;
pk_mins = newPkMins;
opk_mins = newOpkMins;
air_chgs = newAir;
roam_chgs = newRoamChg;
roam_mins = newRoamMin;
no_months = newNoMo;
}
// Mutator methods...
public void setPhone (String newPhone)
{ phone = newPhone; }
public void setMthFee (Double newMthFee)
{ mth_fee = newMthFee; }
// Accessor Methods...
public String getPhone ()
{ return phone;}
public Double getMthFee ()
{ return mth_fee;}
public Double getNrc ()
{ return nrc;}
public Double getPkMins ()
{ return pk_mins; }
public Double getOpkMins ()
{ return opk_mins; }
public Double getAir ()
{ return air_chgs; }
public Double getRoamChg ()
{ return roam_chgs; }
public Double getRoamMin ()
{ return roam_mins; }
public Double getNoMo ()
{ return no_months; }
} // end CustomerUsage.java
Both PsidCustomerUsage.java and CustomerUsage.java compiled successfully and both reside (class files) in the same directory as Test.java. Any suggestions?