In Java
ArrayList<String> strings = new ArrayList<String>();In Pharo
strings := OrderedCollection new.new is a message sent to a classIn Java
Thread regThread = new Thread(
new Runnable() {
@Override
public void run() {
this.doSomething();
}
});
regThread.start();In Pharo
[ self doSomething ] forkIn Java 8
new Thread(() -> this.doSomething()).start();In Pharo
[ self doSomething ] fork5 factorial
Transcript cr3 + 4
5 -> 10Transcript show: 'hello world'
2 between: 0 and: 5In Java
receiver.keyword1keyword2(arg1, arg2)In Pharo
anObject keyword1: arg1 keyword2: arg2In Java
postman.send(mail,recipient); postman.send(mail,recipient);
postman . send ( mail , recipient ); postman.send(mail,recipient);
postman . send ( mail , recipient );
postman send mail recipient postman.send(mail,recipient);
postman . send ( mail , recipient );
postman send mail recipient
postman send mail to recipient postman.send(mail,recipient);
postman . send ( mail , recipient );
postman send mail recipient
postman send mail to recipient
postman send: mail to: recipientIn Java
postman.send(mail,recipient);In Pharo
postman send: mail to: recipientsend:to:postmanmail and recipient)if, else, for, while, do, ... are language keywordsfullName isEmpty
ifTrue: [ 'FirstnameLastname' ]
ifFalse: [ fullName ]4 timesRepeat: [ self doSomething ]0 to: 100 do: [ :i | ... ]0 to: 100 by: 3 do: [ :i | ... ]aCollection do: [ :each | ... ]/