Skip to content

Instantly share code, notes, and snippets.

@0guzhan
Last active December 12, 2018 20:37
Show Gist options
  • Save 0guzhan/a7b8c385a4769baea65a9da1471160d8 to your computer and use it in GitHub Desktop.
Save 0guzhan/a7b8c385a4769baea65a9da1471160d8 to your computer and use it in GitHub Desktop.

void is not a type in java.

because void keyword in java tells the behaviour of java execution stack which is a completely empty stack at the end of void method execution (not returning a type). this yields a distinction between expressions and statements in java language. in contrary to java, in scala everything is expression thus always returns (or evaluates to) sth.

scala types

AnyVal: all primitive types + void (unit) AnyRef: all java ref (object) types + all scala ref types Any: AnyVal + AnyRef

there is no static methods and variables in scala :o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment