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

  • Home
  • SEARCH
  • 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 7411827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:26:50+00:00 2026-05-29T06:26:50+00:00

I am getting the error java:35: error: illegal character: \29, all this should do

  • 0

I am getting the error java:35: error: illegal character: \29, all this should do is when a user clicks on the label it changes from “H” to “T”

I am also getting error: ‘;’ expected
}

and error: reached end of file while parsing
}

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;


class Lab3Label extends JLabel{

    Lab3Label () {
        this.addActionListener(new FlipTheCoinListener());
    }



    public void FlipTheCoin(){
        int count = 0;
        if(count % 1 == 0 ){
            this.setText("H");
            count += 2;
        }
        else{
            this.setText("T");
            count -= 2;
        }
    }


}

        class FlipTheCoinListener implements ActionListener{


            public void actionPerformed(ActionEvent e){
             this.FlipTheCoin();
            }
    }

^ is the line in question

  • 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-05-29T06:26:52+00:00Added an answer on May 29, 2026 at 6:26 am

    You have a funny character on that line, as evidenced by the actual error you’re getting, complaining about \29. It may be because you cut and pasted the code in from somewhere with the extraneous character.

    If you really wanted to investigate properly, you could examine the hex contents of the file such as with (UNIXy systems):

    od -xcb sourcefile.java
    

    but it’s probably easier just to delete the line totally and retype it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting java:105: error: illegal character: \29 } I am writing a program
I am getting the following error in RAD: java.net.URISyntaxException: Illegal character in path at
From someone's project, I am getting this error: Java Build Path Problems (1 item)
I'm getting a java.awt.FontFormatException: Unrecognised Font Format error, and I believe this has been
Why am I getting the error :java:16: error: illegal start of type for(int i
I am getting this error: java.net.MalformedURLException: Protocol not found[java.lang.StringBuilder] When the following line is
I'm simulating a overload of a server and I'm getting this error: java.lang.OutOfMemoryError: unable
I keep getting this error: java.lang.NoClassDefFoundError: org/apache/lucene/index/memory/MemoryIndex Is there any way i can go
In my Android application for reading RSS links, I am getting this error: java.net.UnknownHostException:
I am getting error ERROR/AndroidRuntime(1482): java.lang.NullPointerException from my ImageAdapter class.Please Help me to solve

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.