1 Replies - 354 Views - Last Post: 21 August 2013 - 06:53 AM Rate Topic: -----

#1 Anitush  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 29-October 12

error with code not sure what is wrong. Just starting out.

Posted 21 August 2013 - 06:13 AM


import java.io.*;

public class Employee
{
//declare class variables
String firstName, lastName, position;
float rate, hours;

public Employee(String f, String l, String p, float r, float h)
{
//assign single letter to their class variables
firstName = f;
lastName = l;
position = p;
rate = r;
hours = h;
}

public Employee(String f, String l, String p)
{
public String getFirstName
{
return firstName;
}
public String getLastName
{
return lastName;
}
public String getPosition
{
return position;
}
public float getRate
{
return rate;
}
public float getHours
{
return hours;
}
}
}



Employee.java:31: illegal start of expression
public String getFirstName

I have been searching the net and the books I have and I cannot see what the problem is the the start of my line.
^

Is This A Good Question/Topic? 0
  • +

Replies To: error with code not sure what is wrong. Just starting out.

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13566
  • View blog
  • Posts: 54,121
  • Joined: 12-June 08

Re: error with code not sure what is wrong. Just starting out.

Posted 21 August 2013 - 06:53 AM

Closing duplicate topic.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1