Howdy. The inequailty operator in java is != not <> memory = memory - 1024; d = d + 1; for example could be written as: memory -= 1024; d++; but that's a matter of personal taste I guess. The TerminalIO package is from a book perhaps so I can't comment on that. Use ubb code tags around your code in future as it makes it easier for ranchers to read.

Peter, When posting code sample(s), it is best if you place them inside UBB [code] tags. This will retain your code�s indentation and formatting when it is displayed (at least in most web browsers). It will also cause most web browsers to use a monospaced font when displaying it. All of this makes reading the code much easier. Some folks won't even try to read your code if it is not in [code] [/code] tags.Take a look at the information on the Using UBB Tags page for more information. But ultimately, it is as simple as placing your code between a set of [code] and [/code] tags. So if in the posting window you type: [code] public class SomeClass { more code typed here } [/code] It will be displayed as:

Regards, and welcome to the ranch.

Peter Shipway
Ranch Hand

Joined: Mar 25, 2004
Posts: 71

posted Apr 05, 2004 22:40:00

0

Thanks for the tip and the info about UBB codes, I changed the <> operater to != and It still dosent work, Its like its an never-ending loop, my machine usally crashes... Oh and I have terminalIO package set-up correclty on my computer, tested other programs... [ April 05, 2004: Message edited by: Peter Shipway ]

Just make a simple test with pencil and paper: let memory become 64 memory > 1024 --> no ... memory > 64 --> no Therefore, memory stays 64, and it loops forever. Try memory >= 64 and see, what happens. ;-) BTW, what if I enter something like 64 + 1? Or is this considered as invalid input?