Help with this piece of coding please

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Shaitann

Thread Starter
Joined
Dec 1, 2016
Messages
4
Every time I run it I get "Illegal start of expression" and stuff like ' ) ' expected and ' ; ' expected. Please help

public class Employee
{
private double myhours;
private String myname;
private double myhourlyrate;

public static void main (String[] args)
{

{
public Employee (String name)
{
myname=name;
}

public Employee(double hourlyrate)
{
myhourlyrate=0.0;
}

public employee(double hours)
{
myhours=0.0
}



public Employee(double hours, String name, double hourlyrate)
{
myhours=hours;
myname=name;
myhourlyrate=hourlyrate;
}




public double getHours()
{
return myhours;
}


public String getName()
{
return myname;
}


public double getHourlyRate()
{
return myhourlyrate;
}


public void setHours(double hours)
{
myhours=hours;
}


public void setName(String name)
{
myname=name;
}


public void setHourlyRate(double hourlyrate)
{
myhourlyrate=hourlyrate;
}

}
 

Attachments

Joined
Dec 12, 2015
Messages
5
public static void main (String[] args)
{

{

You "open" that one twice instead of closing it, the result is +2 opening brackets.




Edit :
public employee(double hours)
{
myhours=0.0
}

; expected
 

Shaitann

Thread Starter
Joined
Dec 1, 2016
Messages
4
yes, i also needed to name this constructor;

public employee(double hours)
{
myhours=0.0
}

the same as the class
 

Cookiegal

Karen
Administrator
Malware Specialist Coordinator
Joined
Aug 27, 2003
Messages
117,162
Thread closed as it's homework.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top