This preview shows page 1. Sign up to view the full content.
Unformatted text preview: () method which is invoked
for the defined keyboard. Texts inside double quote characters
" " are strings of characters that will be
displayed on the screen. \n among the
text means that the text will begin from
a new line. \n is said to be the newline
character. Game.java - 1.+ A program that implements a simple computer game. 5.1 Integer variables (int, short, long, byte, char) When we write System.out, we can refer to the
screen of the computer. print() is a method that can be
invoked by writing System.out.print( ... ), and
this method invocation (or method call) writes data to the
screen. Here, the text that is going to be displayed on the
screen consists of two strings of characters. These two
character strings are concatenated with operator +. 103 After this assignment statement
has been executed, the value of
is one greater than the value stored
in integer_from_keyboard. System.out.print(
"\n This program is a computer game. Please, type in "
+ "\n an integer in the range 1 ... 2147483646 : " ) ;
View Full Document
This document was uploaded on 01/20/2014.
- Winter '14