| | |
cannot find symbol error message
![]() |
•
•
Join Date: Sep 2007
Posts: 15
Reputation:
Solved Threads: 0
Here the error i get from the file below
here the file which it is referring to to
Java Syntax (Toggle Plain Text)
F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:1: cannot find symbol symbol : class Calender location: package java.util import java.util.Calender; ^ F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:22: cannot find symbol symbol : class DateComponent location: class FulltimeEmployee DateComponent dc = new DateComponent(date); ^ F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:22: cannot find symbol symbol : class DateComponent location: class FulltimeEmployee DateComponent dc = new DateComponent(date); ^ F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:27: cannot find symbol symbol : class Calender location: class FulltimeEmployee Calender today = Calender.getInstance(); ^ F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:27: cannot find symbol symbol : variable Calender location: class FulltimeEmployee Calender today = Calender.getInstance(); ^ F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:28: cannot find symbol symbol : variable Calender location: class FulltimeEmployee year = today.get(Calender.YEAR); ^ F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:29: cannot find symbol symbol : variable Calender location: class FulltimeEmployee month = today.get(Calender.MONTH); ^ F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:30: cannot find symbol symbol : variable Calender location: class FulltimeEmployee day = today.get(Calender.DAY_OF_MONTH); ^ F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:34: unexpected type required: variable found : value vacationDays = (year - yy) = VACATION_DAYS_PER_YEAR; ^ F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:38: unexpected type required: variable found : value vacationDays = (year - yy - 1) = VACATION_DAYS_PER_YEAR; ^ F:\JAVA\Java Files\lab employee\FulltimeEmployee.java:45: return outside method return salary; ^ 11 errors Tool completed with exit code 1
here the file which it is referring to to
Java Syntax (Toggle Plain Text)
import java.util.Calender; public class FulltimeEmployee extends Employee { protected double salary; private final int VACATION_DAYS_PER_YEAR = 30; public FulltimeEmployee(String name, String dateHired, double salary) { super(name, dateHired); this.salary = salary; } public int getVacationDays() { int mm, dd, yy; int month, day, year; int vacationDays; String date; date = getDateHired(); DateComponent dc = new DateComponent(date); mm = dc.getMonth(); dd = dc.getDay(); yy = dc.getYear(); Calender today = Calender.getInstance(); year = today.get(Calender.YEAR); month = today.get(Calender.MONTH); day = today.get(Calender.DAY_OF_MONTH); if ((month < mm) || ((month == mm) && (day <=dd))) { vacationDays = (year - yy) = VACATION_DAYS_PER_YEAR; } else { vacationDays = (year - yy - 1) = VACATION_DAYS_PER_YEAR; } return vacationDays; } public double getSalary; { return salary; } }
Last edited by java_starter; Oct 17th, 2007 at 9:24 pm.
•
•
Join Date: Sep 2007
Posts: 15
Reputation:
Solved Threads: 0
after fixing the calendar spelling error and after that i am still getting the following error please help...
Java Syntax (Toggle Plain Text)
F:\JAVA\Java Files\lab employee\FullTimeEmployee.java:22: cannot find symbol symbol : class dateComponent location: class FullTimeEmployee dateComponent dc = new DateComponent(date); ^ F:\JAVA\Java Files\lab employee\FullTimeEmployee.java:22: cannot find symbol symbol : class DateComponent location: class FullTimeEmployee dateComponent dc = new DateComponent(date); ^ F:\JAVA\Java Files\lab employee\FullTimeEmployee.java:34: unexpected type required: variable found : value vacationDays = (year - yy) = VACATION_DAYS_PER_YEAR; ^ F:\JAVA\Java Files\lab employee\FullTimeEmployee.java:38: unexpected type required: variable found : value vacationDays = (year - yy - 1) = VACATION_DAYS_PER_YEAR; ^ F:\JAVA\Java Files\lab employee\FullTimeEmployee.java:43: missing method body, or declare abstract public double getSalary(); ^ F:\JAVA\Java Files\lab employee\FullTimeEmployee.java:45: return outside method return salary; ^ 6 errors
•
•
Join Date: Oct 2007
Posts: 8
Reputation:
Solved Threads: 0
Java Syntax (Toggle Plain Text)
vacationDays = (year - yy) = VACATION_DAYS_PER_YEAR;
That doesn't seem right. I don't know what you want to do so i can't really help, but since "VACATION_DAYS_PER_YEAR" is set to final and set to "30" then you are basically taking the 30 and assigning it to "(year -yy)" and then assigning "(year-yy)" to "vacactionDays" I'm bad at explaining, but can't do that, I think.
When you do more than one equal like that it usually for a 2 things with the same value like:
"int x = y = 4;"
Last edited by Amurka; Oct 18th, 2007 at 1:13 am.
![]() |
Similar Threads
- First Attempt at Arrays (Java)
- not to sound cliche, but...help me please! (Java)
- Cannot find symbol (Java)
- cannot find server error message (Web Browsers)
- Error Message: Cannot find server; page cannot be displayed (Viruses, Spyware and other Nasties)
- Another "cannot find symbol" compiling error (Java)
- IE Cannot find Server error, spyware, hijack (Viruses, Spyware and other Nasties)
Other Threads in the Java Forum
- Previous Thread: How to display the number of tens,ones and tenths in a given float value?
- Next Thread: code is nopt updating the database as given below
| Thread Tools | Search this Thread |
2dgraphics @param account affinetransform android api apple applet application arc arguments array automation banking binary binarytree bluetooth chatprogramusingobjects class client code color compare component count database derby design detection eclipse eclipsedevelopment encryption error fractal game givemetehcodez graphics gridlayout gui guitesting helpwithhomework homework html if_statement image inheritance integer j2me java java.xls javadesktopapplications javaprojects jlabel jni jpanel julia keytool keyword linux list macintosh method methods midlethttpconnection mobile monitoring netbeans nullpointerexception object open-source pong problem producer program projectideas property reference replaysolutions ria rim scanner server set size sms sourcelabs splash sql sqlite swing terminal testautomation threads transforms tree ui unicode validation web windows





