Skip to content

Instantly share code, notes, and snippets.

@vic
Created July 21, 2010 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vic/485195 to your computer and use it in GitHub Desktop.
Save vic/485195 to your computer and use it in GitHub Desktop.
Hello world example in Akin Java
# Hello World example in Akin Java
#
# Akin (http://github.com/vic/akin)
package: akin example.
# I made imports explicit just to show
# how to import classes static members
import: java lang String,
java lang Runnable,
java lang System out
# To create a subclass the syntax will be
# <ParentClass> class(<Interface>,<Interface2>, <ClassBody>)
# If no ParentClass specified, it will be java.lang.Object
Hello = class(Runnable):
# Akin Java will have type inference
final static private hello = "Welcome to Akin"
initialize =: @name
{Override} run =:
5 times(i): out println(i+": "+toString)
toString() = "$(hello): $(name)"
static main(argv String[]) = new(argv[0]) run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment