View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Java vs. Smalltalk - Yoko Ishioka

You probably have had at least a little bit of experience with Java, so what is this Smalltalk all about?! Read further for an in-depth comparison that will hopefully give you better clarity.

ActionJavaSmalltalk
calling itselfthisself
ending statement;.
return statementreturn^
comparison.equals=
assignment=:=
comments//i'm a comment//"i'm a comment"
code block{}[]
declare an arrayint[] myArray = {1, 2};#($1 $2)
make new instancef = new Foo();f := Foo new.

Some other things to consider:

There are no keywords in Smalltalk.
Smalltalk has late-binding resolution, meaning it doesnít check for errors except at runtime.
You donít declare variable types in Smalltalk.
In Smalltalk, all methods are public and all variables are set to private.
In Smalltalk, every method returns something. If you donít specify, then it returns self.

Link to this Page