Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8503421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:45:16+00:00 2026-06-11T01:45:16+00:00

Ok, I looked through a lot of forums in this website and I cannot

  • 0

Ok, I looked through a lot of forums in this website and I cannot find my problem. I keep getting an error stating “cannot find symbol” and points to the “n” in “new” on my EmployeeTest app. Here is my code:

first file:

import java.util.Scanner;

public class Employee

{

    private String fName;
    private String lName;
    private Double mSalary;

    public Employee( String first, String last, Double mth)
    {
        fName = first;
        lName = last;
        if ( mth > 0.00 )
            mSalary = mth;

        if ( mth < 0.00 )
            mSalary = 0.00;
    }

    public void setFName( String first )
    {
        fName = first;
    }

    public void setLName( String last )
    {
        lName = last;
    }

    public void setMSalary( Double mth )
    {
        mSalary = mth;
    }

    public String getFName()
    {
        return fName;
    }

    public String getLName()
    {
        return lName;
    }

    public Double getMSalary()
    {
        return mSalary;
    }

    public void displayMessage()
    {
        System.out.printf( "%s %s has a monthly salary of $%.2f\n",
            getFName(),
            getLName(),
            getMSalary() );
    }
}

Second file:

public class EmployeeTest

{

    public static void main( String[] args )
        {
            Employee myEmployee = new Employee( 
                "Fred", "Rogers", "10" );

            System.out.printf( "Employee's first name is: %s\n",
                myEmployee.getFName() );
            System.out.printf( "\nEmployee's last name is: %s\n",
                myEmployee.getLName() );
            System.out.printf( "\nEmployee's monthly salary is: %d\n",
                myEmployee.getMSalary() );
        }
}

I have a feeling it has to do with my constructor but I cannot find out what the problem is! I must have looked over my code a ka-jillion times!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:45:17+00:00Added an answer on June 11, 2026 at 1:45 am

    changing EmployeeTest

    Employee myEmployee = new Employee("Fred", "Rogers", "10" );
    

    to:

    Employee myEmployee = new Employee( "Fred", "Rogers", 10d );
    

    and:

    System.out.printf( "\nEmployee's monthly salary is: %d\n", myEmployee.getMSalary() );
    

    to:

    System.out.printf( "\nEmployee's monthly salary is: %f\n", myEmployee.getMSalary() );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this error a lot: Feature ' {insert feature here} ' cannot
I looked through the existing questions of this kind but didn't find what I
I have looked through a lot of various articles and have yet to find
I have looked through a lot of information about this, but I haven't quite
I have looked through a lot of the other questions for this issue and
I looked through other questions and couldn't find what I needed. Best if I
I've looked through tons of posts and cannot figure out why I can't get
I've looked through several Google searches now, and continue to keep coming up empty
Disclaimer: I have looked through this question and this question but they both got
I have looked through a lot of the Missing ';' before 'x' questions, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.