chapter_5_beginning_javabook

2147483646 2147483647 you typed in 2147483647 my

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: he game is over. D:\javafiles2>java Game This program is a computer game. Please, type in an integer in the range 1 ... 2147483646 : 2147483647 You typed in 2147483647. My number is -2147483648. Sorry, you lost. I won. The game is over. Game.java - X. In the second execution too large an input value is given to the program. 104 Chapter 5: Variables and other basic elements in Java programs , We can think that the main memory of a computer is a long list of single-byte memory cells, and each byte has a unique address. I have written here "fictitious" hexadecimal memory addresses. The addresses are fictitious because we do not usually know, and we do not need to know, the numerical memory addresses of variables. Here we suppose that these four bytes of memory are reserved for variable one_larger_integer. We can say that variable one_larger_integer is in memory address 12F8C0H. The contents of the memory locations are marked with ??H because right after their declaration the variables have unspecified values. We have here...
View Full Document

Ask a homework question - tutors are online