I would really appreciate some help on what seems to be an easy error to fix, I'm a beginner and have been stuck on this for 2 hours.
Eclipse gives me two errors that expect me to start and end a random block. In the code I give, I comment on the two lines where there are errors. This is what those errors say:
1.Syntax error on token ";", { expected after this token
2.Syntax error, insert "}" to complete Block
This is the code from my unfinished class (I comment where the two errors are):
//import java.awt.*;
import java.awt.event.*;
//import java.util.Collection;
//import java.util.LinkedList;
import java.util.*;
import javax.swing.*;
public class Controller implements ActionListener
{ //private Model model;
private View view;
//create linked list to hold employees
Collection c; //ERROR ON THIS LINE
c = new LinkedList ();
//create a few employees to use
Employee emp;
emp = new Employee("Hugh Jackman", "609-66-9598", 90000.00, Employee.maritalStatus.single);
Manager man;
man = new Manager("Software Manager", 100.00, "John Smith", "678-57-1295",
120000.00, Employee.maritalStatus.married);
Worker wor;
wor = new Worker("Hugo Boss", "Clothing", "Andrew Park", "534-47-9876",
15000, Employee.maritalStatus.partner); //ERROR ON THIS LINE
public Controller()
{
view = new View(this);
//model = new Model();
}
public static void main(String args[])
{
// instantiates itself to get its own constructor going
Controller ctr = new Controller();
}
public void actionPerformed (ActionEvent evt)
{
//System.out.println((JMenuItem)evt.getSource());
if (((AbstractButton) evt.getSource()).getText() == "Employee")
{
c.add(emp);
view.show("Employee added!");
}
}
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)