I get an error of Invalid character constant what am I doing wrong?

syntaxerror: invalid character
syntaxerror: missing
javascript remove non printable characters
error illegal character u00ac
template literals javascript w3schools
javascript replace special characters with ascii
how to handle in javascript
javascript backslash in string
 do {
  System.out.println("What is the Secret Word");
  secretWord.equalsIgnoreCase("Water");
   if (secretWord != 'Water')
    secretWord.equalsIgnoreCase("Water");
  }

I'm trying to make the user guess the word Water, if they don't then it would promt the user to guess again. If they get it right, the program would echo the secret word Water


  1. On your 4th line down, you need to change 'Water' to "Water" because it is a String.
  2. You are also missing the brackets for your if statement.
  3. The != in the line secretWord != "Water" is not used to determine if a String does not equal another String. Instead use .equals to determine is a String equals another String.

Try this code instead:

Scanner scanner = new Scanner(System.in);
do {
          System.out.println("What is the Secret Word");
          String secretWord = scanner.next();
          secretWord.equalsIgnoreCase("Water"); // Delete this - line does nothing
           if (!secretWord.equals("Water")) {
            secretWord.equalsIgnoreCase("Water");
          } 
        }while (!secretWord.equals("Quit"));

Also, you tagged Java and Javascript on this question. Those are two completely different languages. I'm assuming that you probably just meant Java.

"invalid character constant" error, where the two single quotes are saying "invalid character constant" I'm not sure what i am doing wrong. any tips? share. Why am I getting an invalid character constant for the '[ in Java? [closed] do you know what am I doing wrong with this I am new to Java and not sure if that


Here's a way to do what you described – to prompt the user for a secret word repeatedly until they get it right.

It sets up a Scanner to capture input from the keyboard, then repeatedly loops – while (true) { ... } – printing something to the user, capturing the input, and checking if it matches "water". If it matches, it prints a messages and uses break to get out of the while loop.

Scanner scanner = new Scanner(System.in);
while (true) {
    System.out.print("What is the Secret Word? ");
    String input = scanner.next();
    if (input.equalsIgnoreCase("water")) {
        System.out.println("you guessed right!");
        break;
    }
}

Invalid character constant in Expression builder, but I get a Invalid character constant error message. What am I doing wrong? Thanks in advance. Labels: All  The backslash is the Java string escape character - '\' is a single quote opening a character constant, followed by the (escaped) character which is a single quote, with no following terminator thereby invalid. I think you meant '\\'.


Try the below Code.

do {
    System.out.println("What is the Secret Word");
    if (!secretWord.equalsIgnoreCase("Water"))
        System.out.println("Water is not Equal.");
}

Error: Invalid character constant, How to fix the error below? org.talend.designer.runprocess. ‎05-08-2019 03:26 AM Detail Message: Invalid character constant @Talented ,can you show your job design ? what exactly are you doing? need to specify some settings in tfileoutputxml,may which you have not set. Output is incorrect. You won't see a warning that the CAPTCHA is invalid. If your CAPTCHA isn't being accepted, the problem might not be with your reading or your typing, the code may simply have expired. Try reloading the page to get a new code, then fill out and submit the form right away.


secretWord != 'Water' 

u have to use " instead of '

SyntaxError: illegal character, The JavaScript exception "illegal character" occurs when there is an invalid or SyntaxError: Invalid character (Edge) SyntaxError: illegal character What went wrong? Some characters look similar, but will cause the parser to fail and you're not able to find the source of the problem, it's often best to  Save the file. Notes. This won’t apply for the existing files that are already set to CRLF. It will apply for the newly created files. You might need to restart VS Code after the edit, as Biggs pointed out in the comments.


Errors and Warnings Reference Guide: List of the armcc error and , This error can occur when a character value described by a hex constant is too large If it is necessary to do this, undefine the macro using #undef before the 78 : a parameter declaration may not have an initializer 84 : invalid combination of type specifiers The following incorrect C code causes an error in all modes. You can easily solve the keyboard typing wrong characters issue, just by pressing Fn + Num Lock key together in few laptop/PC models. However, if the issue is still not resolved, follow any of the 2 methods listed below to fix the keyboard typing random characters issue. Method 1: By Manually Changing Input Language


nim-lang/Nim, <yglukhov> ah now youre getting syntax error. try use normal slash. <yglukhov> the unix style bin = @["src\main"] gives invalid character. bin = @["src/main"]  Although this seems like a problem that could be easily fixed, he found that e ven after he edited the phone number in his contacts and added the area code, he still got the “invalid number” texts when he tried to communicate with that contact.


ORA-00910 to ORA-01497, Cause: A synonym did not translate to a legal target object. The synonym specifies an incorrect database link. 4. For Trusted Oracle users getting this error although granted the the appropriate ORA-01040: invalid character in password; logon denied Cause: Constants of different types are specified in an in-list. You omitted an operand or operator, you entered an invalid character or comma, or you entered text without surrounding it in quotation marks. If the field name contains a brace ({}), you receive the following error message: Malformed GUID in query expression ' ObjectName '