Created
May 4, 2016 02:09
-
-
Save boloutaredoubeni/264ee6b9ce796806248fb0a311bfde29 to your computer and use it in GitHub Desktop.
Swift vs Java
This file contains hidden or 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 MyClass { | |
| private int myVar; | |
| public MyClass(int myVar) { | |
| this.myVar = myVar; | |
| } | |
| public int myMethod() { | |
| return myVar; | |
| } | |
| public void myOtherMethod() { | |
| /// do something | |
| } | |
| public static void main(String ..args) { | |
| final MyClass myJavaClass = new MyClass(1); | |
| } | |
| } |
This file contains hidden or 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 MyClass { | |
| let myVar: Int? | |
| init(_ myVar: Int) { | |
| self.myVar = myVar | |
| } | |
| public func doSometing() { | |
| /// do something | |
| } | |
| } | |
| let myClass = MyClass(9) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment