chapter_5_beginning_javabook

Texts inside double quote characters are strings of

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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 variable one_larger_integer 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 : " ) ; intege...
View Full Document

This document was uploaded on 01/20/2014.

Ask a homework question - tutors are online