Created
May 1, 2013 19:25
-
-
Save ottok/5497666 to your computer and use it in GitHub Desktop.
JavaScript and C# comparison
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
class foo { | |
protected var findMe = 100; | |
} | |
class bar extends foo { | |
class baz extends foo { | |
public function Constructor() { | |
console.log("baz: " + findMe); | |
} | |
} | |
public function Constructor() { | |
findMe = 5; | |
console.log("bar: " + findMe); | |
new baz(); | |
} | |
} | |
new bar(); | |
class foo { | |
protected int findMe = 100; | |
} | |
class bar : foo { | |
class baz : foo { | |
public baz() { | |
System.Console.WriteLine("baz: " + findMe); | |
} | |
} | |
public bar() { | |
findMe = 5; | |
System.Console.WriteLine("bar: " + findMe); | |
new baz(); | |
} | |
} | |
class MainClass { | |
public static void Main (string[] args) { | |
bar _bar = new bar(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment