Last active
June 21, 2016 18:18
-
-
Save micronix/984b85878f9b4ac06db6ca0ea237d330 to your computer and use it in GitHub Desktop.
Ruby no variable declaration
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
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 | |
} | |
} |
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
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