| | |
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 |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card class classes client code collision columns component constructor crashcourse database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress integer intellij j2me java javadoc javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle physics plazmic print problem program project radio recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree trolltech unlimited utility webservices windows





