Results 1 to 16 of 16
  1. #1
    Hamodi18 Guest

    Default Error Message ..

    im getting an error message and I cannot compile it.. error message with public void setBasicSalary (float basicSalary) {
    it says that illegal start of expression ..

    these are the cods
    Last edited by Hamodi18; 07-11-2010 at 03:19 AM. Reason: Moderator Edit: Code tags added

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I hope you don't mind that I edited your code and added code tags which should help make your posted code retain its formatting and be more readable.

    To do this yourself, highlight your pasted code (please be sure that it is already formatted when you paste it into the forum; the code tags don't magically format unformatted code) and then press the code button, and your code will have tags.

    Another way to do this is to manually place the tags into your code by placing the tag [code] above your pasted code and the tag [/code] below your pasted code like so:

    Java Code:
    [code]
      // your code goes here
      // notice how the top and bottom tags are different
    [/code]

    Now as to your problem, look at the code here:
    Java Code:
        public float getBasicSalary () {
            return basicSalary;
        //  **** missing closing brace here
    
        public void setBasicSalary (float basicSalary) {
            this.basicSalary = basicSalary
        }
    Your curly braces don't match up.

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default

    There may be mismatched {} or () in the code. Does your editor have "Find matching" capability?

    Please copy and paste the FULL text of the error message here. Don't edit it.

  4. #4
    Hamodi18 Guest

    Default

    yeah bro ,,thanks alot and sorry because im new in this forum..
    According to the question I also got an error message in
    Java Code:
     public float getCommisionRate () {
            return commisionRate;
        }
        public void setCommisionRate (float commisionRate) {
            this.commisionRate = commisionRate;
        }

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default

    I also got an error message
    Please post full text of the error message. No mind readers on shift tonight.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Hamodi18 View Post
    yeah bro ,,thanks alot and sorry because im new in this forum..
    No problem. I just figured if you learned how to use the tags, you'll be able to post better questions and get more help. Glad you figured it out.

    According to the question I also got an error message in
    Java Code:
     public float getCommisionRate () {
            return commisionRate;
        }
        public void setCommisionRate (float commisionRate) {
            this.commisionRate = commisionRate;
        }

    I'm with Norm here: what is the full text of the error message.

    Much luck!

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default

    Comment on java naming conventions:
    Class names start with Upper case letters

  8. #8
    Hamodi18 Guest

    Default

    bro , is not big deal whether the class names start with big letters ..
    Java Code:
    public float getCommisionRate () {
            return commisionRate;
        }
        public void setCommisionRate (float commisionRate) {
            this.commisionRate = commisionRate;
        }
    the text is the same : illegal start of expression

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Hamodi18 View Post
    bro , is not big deal whether the class names start with big letters ..
    To you it's not, but to us who've you asked to review quite a bit of your posted code, it is a big deal. If your code doesn't follow convention then we have a harder time understanding it, and you are less likely to get help (or get a poorer grade from your teacher, lower salary from your boss,... etc). So fine, don't follow conventions, but if you want free help here and care to show the folks giving you help that you appreciate their work, please put in the small effort to make it easier for them to help you.


    Java Code:
    public float getCommisionRate () {
            return commisionRate;
        }
        public void setCommisionRate (float commisionRate) {
            this.commisionRate = commisionRate;
        }
    the text is the same : illegal start of expression
    Your problem is exactly the same. Look at your original code to see this is so.

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,423
    Rep Power
    25

    Default

    Please post the FULL text of the error message. Do NOT edit it or remove any parts of it.

  11. #11
    Hamodi18 Guest

    Default

    im sorry ,, wanna ask u
    From where can I delete my thread ..

  12. #12
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  13. #13
    Hamodi18 Guest

    Default

    because I feel disappointed ...

  14. #14
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Hamodi18 View Post
    because I feel disappointed ...
    Whatever for? I hope it's not something we've done or said here.

  15. #15
    Hamodi18 Guest

    Default

    no actually you were trying to help me , but Norm always replay in my thread without any useful answer he just keep asking my by putting all the codes. and im not comfortable to see his replay ..:(

  16. #16
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Hamodi18 View Post
    no actually you were trying to help me , but Norm always replay in my thread without any useful answer he just keep asking my by putting all the codes. and im not comfortable to see his replay ..:(
    He was simply asking for your error messages, not your code. Without the exact error messages, it is hard to know what the precise problem is. Believe me, if you follow his advice, you will get better help, and I don't just mean about posting the error messages -- I mean all his advice. He is one of the best coders and one of the most patient volunteers that this site has.

Similar Threads

  1. error message assistance
    By Sean_J in forum New To Java
    Replies: 12
    Last Post: 03-17-2010, 02:27 AM
  2. error message - non-static
    By newbie123 in forum New To Java
    Replies: 5
    Last Post: 03-15-2010, 02:25 PM
  3. Error Message????
    By Cubba27 in forum New To Java
    Replies: 11
    Last Post: 11-21-2009, 02:46 PM
  4. java error message
    By baileyr in forum New To Java
    Replies: 2
    Last Post: 01-23-2008, 03:47 AM
  5. error message on jsp
    By sandor in forum Web Frameworks
    Replies: 1
    Last Post: 04-11-2007, 02:10 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
  •