Home > Back-end >  java
java

Time:10-08

Using CMD runtime errors not mapping of GBK character, how to solve, help bosses

CodePudding user response:

1. You need to check the code
2. Do you have in this code. There is a need to introduce Java util. The Scanner

CodePudding user response:

Encoding is utf-8

CodePudding user response:

reference 1/f, antell whoops response:
1. You need to check the code
2. Do you have in this code. There is a need to introduce Java util. Scanner

Where is the introduction, I Java small white

CodePudding user response:

reference 3 floor ha ha ha hello, reply:
Quote: reference 1/f, antell whoops reply:
1. You need to check the code
2. Do you have in this code. There is a need to introduce Java util. Scanner

Where is the introduction, I Java small white

 import Java. Util. Scanner; 

Public class Test {

Public static void main (String [] args) throws the Exception {
System. The out. Println (" please enter a natural number: ");
Scanner scan=new Scanner (System. In);
Int num=scan. NextInt ();
If (num % 2==0) {
System. Out. Println (num + "is an even number");
}
}
}

CodePudding user response:

refer to the second floor, ha ha ha hello, reply:
encoding is utf-8

Javac - input encoding utf-8 test1. Java can compile

CodePudding user response:

Plus one upstairs, specify a code compiler itself can: javac - encoding utf-8 *. Java, you can try to modify the default encoding notepad, the upper left corner set in, Java is GBK by default

CodePudding user response:

reference antell whoops, 4/f, reply:
Quote: refer to the third floor, ha ha ha hello, reply:

Quote: reference 1/f, antell whoops reply:
1. You need to check the code
2. Do you have in this code. There is a need to introduce Java util. Scanner

Where is the introduction, I Java small white

 import Java. Util. Scanner; 

Public class Test {

Public static void main (String [] args) throws the Exception {
System. The out. Println (" please enter a natural number: ");
Scanner scan=new Scanner (System. In);
Int num=scan. NextInt ();
If (num % 2==0) {
System. Out. Println (num + "is an even number");
}
}
}

Crab crab crab crab

CodePudding user response:

HMMM ok??????????

CodePudding user response:

refer to 6th floor crystal seed response:
plus one upstairs, specify a code compiler itself can: javac - encoding utf-8 *. Java, you can try to modify the default encoding notepad, the upper left corner set in, Java defaults to GBK

Crab crab??????