Learn Java Programming - Exercise 01x - Keyboard Input

preview_player
Показать описание

Learn and practice writing code to read keyboard characters into variables for later use in Java.
Рекомендации по теме
Комментарии
Автор

2:01


T >084
t> 116

the numbers 084 and 116 is what JAVA sees and they are different numbers.
JAVA uses UNICODE and that's what it sees, Ascii is a subset of UNICODE .

This was mentioned briefly on lesson 20 when Jason introduced Char data types.

joeroganpodfantasy
Автор

Excuse Me Sir. this code is not working on ItelliJ Idea:-

public class System_in_Read {
public static void main(String[] args)
throws java.io.IOException{

char input;
System.out.println("Capital of Pakistan is Islamabad (Enter T = Ture or Enter F = False" );
input = (char) System.in.read();

if (input == 'T') System.out.println("Answer is Correct" );
if (input == 'F') System.out.println("Answer is Wrong" );

}
}

shaistakamran
join shbcf.ru