![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Hobbyist Programmer
Join Date: Sep 2004
Location: Cyprus
Posts: 147
Rep Power: 4
![]() |
Thank guys, I managed fixing the first problem, am facing a second problem now, this This is what i get after compiling Database.java file
Note: Database.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for deta So this is what i did moderator@amer:~/Desktop/amer$ javac -Xlint:unchecked Database.java
Database.java:14: warning: [unchecked] unchecked call to addElement(E) as a member of the raw type java.util.Vector
EmployeesData.addElement(emp);
^
1 warning
moderator@amer:~/Desktop/amer$This is my Database.java file code import java.util.*;
import java.io.*;
import java.lang.*;
import java.util.Vector;
public class Database
{
Vector EmployeesData = new Vector();
public void addEmployeeData(Employee emp)
{
(This is line 14)==>> EmployeesData.addElement(emp);
}
public void printEmployeesData (PrintStream ps)
{
Employee tempEmp;
int k=0;
ps.println(new String("Amer Al-Tagi" ));
ps.println(new String("Homework 3: Payroll Calculations:"));
ps.println(new String(""));
ps.println(new String("Full Time Employees"));
ps.println(new String("================================================================="));
ps.println(new String("ID" + " " + "FName" + " " +"LName"+" "+"Dept"+" "+"Salary"));
ps.println(new String("================================================================="));
for (k=0; k<EmployeesData.size(); k++)
{
if (EmployeesData.elementAt(k) instanceof FullTimeEmployee)
{
tempEmp = (Employee) EmployeesData.elementAt(k);
tempEmp.printEmployee(ps);
}
}
ps.println(new String(""));
ps.println(new String("Part Time Employees"));
ps.println(new String("================================================================="));
ps.println(new String("ID" + " " + "FName" + " " +"LName"+" "+"Dept"+" "+"Salary"));
ps.println(new String("================================================================="));
for (k=0; k<EmployeesData.size(); k++)
{
if (EmployeesData.elementAt(k) instanceof PartTimeEmployee)
{
tempEmp = (Employee) EmployeesData.elementAt(k);
tempEmp.printEmployee(ps);
}
}
}
}
__________________
Personal Portfolio TecBrain Support Forum Linux VS Windows ... Dont Even Think of it .. Distribution: Slackware if (OS==Linux) return success There are 10 kinds of people, those who can read binary numbers and those who can't. |
|
|
|
|
|
#12 |
|
Expert Programmer
|
Try replacing line 12 (which you have marked line 14) with this:
Vector<Employee> EmployeesData = new Vector<Employee>(); import java.util.*; import java.io.*; |
|
|
|
|
|
#13 |
|
Hobbyist Programmer
Join Date: Sep 2004
Location: Cyprus
Posts: 147
Rep Power: 4
![]() |
Thanks a lot titaniumdecoy, it works now, i appreciate your help.
__________________
Personal Portfolio TecBrain Support Forum Linux VS Windows ... Dont Even Think of it .. Distribution: Slackware if (OS==Linux) return success There are 10 kinds of people, those who can read binary numbers and those who can't. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|