This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

nccb
nccb presents ...

2012/9/5

String Storage

This tests/shows how to store an int in a single character of a string in the UserInfo class, to put more information into a single UserInfo record.

2266 views / 8 in the last 7 days

Tags: with-source

open in greenfoot
Your browser is ignoring the <APPLET> tag.
HTML5 version not available | Scenario not running?
SPowerSPower

2012/9/9

Is there a limit of the number you enter in a single char?
danpostdanpost

2012/9/9

A character contains two bytes (or 16 bits). Therefore the limit would be 65'535 (2^16-1). See the page on Primitive data types in the java trails at http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html
SPowerSPower

2012/9/9

@danpost That's right, forgot about that. Thanks.

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.