Results 1 to 2 of 2
  1. #1
    Johanis is offline Senior Member
    Join Date
    Oct 2010
    Posts
    139
    Rep Power
    0

    Unhappy Still cannot find symbol!

    Hi, I tried to let one of my classes call another class and it gave me a can not find symbol error. What it is suppose to do is when you click on the calculator button it must call another class that is a calculator. Here is the calculator button:

    private void SakrekenaarMouseClicked(MouseEvent e)
    {
    Calculator cal = new Calculator("Java Swing Calculator");
    }

    Here is the error that it gave me:

    Lone.java:439: cannot find symbol
    symbol : constructor Calculator(java.lang.String)
    location: class Calculator
    Calculator cal = new Calculator("Java Swing Calculator");
    ^

    Then somebody gave a piece of code to fix the problem. Here is the code and his instructions:

    Ah now I see it. Your constructor does not contain a String parameter therefore it cannot identify the constructor, since you passed a string parameter to it.

    Replace your constructor header with this

    Code:

    public Calculator(String param){//Code}

    But this only gave me another error in the calculator class:

    Calculator.java:569: cannot find symbol
    symbol : constructor Calculator()
    location: class Calculator
    Calculator calci = new Calculator();
    ^
    1 error


    Please somebody help me...:(

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Cannot find symbol
    By Johanis in forum New To Java
    Replies: 19
    Last Post: 11-04-2010, 08:13 PM
  2. Can not find symbol ???
    By AliceNewbie in forum New To Java
    Replies: 1
    Last Post: 02-17-2010, 01:44 AM
  3. cannot find symbol
    By GabWit in forum New To Java
    Replies: 3
    Last Post: 01-25-2009, 12:13 AM
  4. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  5. Replies: 3
    Last Post: 05-01-2008, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •