wood burning stoves*
The moose likes Beginning Java and the fly likes java.lang.OutOfMemoryError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java.lang.OutOfMemoryError" Watch "java.lang.OutOfMemoryError" New topic
Author

java.lang.OutOfMemoryError

Suka Hati
Ranch Hand

Joined: Oct 28, 2004
Posts: 56
what is this error all about???
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
often caused by a small error in your code

here's an example (printing the alphabet after your name)



name += name + (char)(x+65);//will generate 'OutOfMemory'

code should be either
name += (char)(x+65);
or
name = name + (char)(x+65);
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: java.lang.OutOfMemoryError