Skip to content

Instantly share code, notes, and snippets.

@micronix
Last active June 21, 2016 18:18
Show Gist options
  • Save micronix/984b85878f9b4ac06db6ca0ea237d330 to your computer and use it in GitHub Desktop.
Save micronix/984b85878f9b4ac06db6ca0ea237d330 to your computer and use it in GitHub Desktop.
Ruby no variable declaration
public class Main {
public static void main(String[] args) {
int a = 1 + 1;
int b = 2;
while (a < 1000) {
a += 1
}
c = "hello there" // would give an error type of variable not stated
a = "this is a string" // would also give an error types cannot change
}
}
def long_method
a = 1 + 1
b = 2
while a < 1000 do
a += 1
end
c = "hello there"
a = "this is a string"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment