Navigation:  Appendix A: Jumping Into Smalltalk >

Literals

Previous pageReturn to chapter overviewNext page

In Smalltalk, integers, characters, strings, booleans, floats and doubles are all first class objects. Integers are infinite precision and automatically grow as needed without overflow. As such, there's no equivalent to char, byte, short, int, or long. They're all just integers.

Java

Smalltalk

5

5

01230

8r1230

0x7f

16r7f

<no equivalent>

3r21012 (you can use any base you like)

200L

<no equivalent>

2e-5

2e-5

2e-5d

2d-5

'h'

$h

'\u03A9'

Character value: 16r3A9

"hello"

'hello'

"can't"

'can''t'