Last active
August 29, 2015 13:57
-
-
Save jesslilly/9663304 to your computer and use it in GitHub Desktop.
Just a little groovy exploration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
// GROOVY STYLE!!!!!!!!!!!!!!!! | |
def a = new ArrayList<String>() | |
a.add("Hello") | |
a.add("my") | |
a.add("name") | |
a.add("is") | |
a.add("Jess") | |
def tabs = "" | |
for (String word in a) { | |
println tabs + word + " " | |
tabs += "\t" | |
} | |
println a.join(" ") + "!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env groovy | |
// JAVA STYLE!!!!!!!!!!!!!!!! | |
ArrayList<String> a = new ArrayList<String>(); | |
a.add("Hello"); | |
a.add("my"); | |
a.add("name"); | |
a.add("is"); | |
a.add("Jess"); | |
String tabs = ""; | |
for (String word in a) { | |
System.out.println(tabs + word + " "); | |
tabs += "\t"; | |
} | |
System.out.println(a.join(" ") + "!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment