|
Re: Russian Letters Are Not Being Recongnized [message #1040817 is a reply to message #1040052] |
Sun, 14 April 2013 05:57 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Alan,
You should consider the issue of character encodings. What encoding is
the "Common" tab of your launcher specifying? Is that also the
default encoding of the JRE you're running? Probably you should
consider specifying UTF-8 for the console and specifying explicitly
using the java.util.Scanner.Scanner(InputStream, String) constructor.
On 13/04/2013 4:50 PM, Alan T wrote:
> import java.util.Scanner;
> public class Main {
> public static void main(String[] args) {
> Scanner sc = new Scanner(System.in);
>
> System.out.println("здравствуйте!");
> String response = sc.nextLine();
>
> if(response.equals ("привет"))
> System.out.println("Correct!");
> else if(response.equals("добрый день"))
> System.out.println("Correct!");
> else if(response.equals("добрый утро"))
> System.out.println("Correct!");
> else if(response.equals("добрый вечер"))
> System.out.println("Correct!");
> else if(response.equals("здравствуйте"))
> System.out.println("Correct!");
> else
> System.out.println("no");
>
> }
>
> }
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02533 seconds