






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.
Action | Java | Smalltalk |
calling itself | this | self |
ending statement | ; | . |
return statement | return | ^ |
comparison | .equals | = |
assignment | = | := |
comments | //i'm a comment// | "i'm a comment" |
code block | {} | [] |
declare an array | int[] myArray = {1, 2}; | #($1 $2) |
make new instance | f = 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
- Cases last edited on 30 July 2011 at 2:33 am by r59h132.res.gatech.edu