Created
October 24, 2016 19:20
-
-
Save reynoldsm88/ceb9b44d60628b81b65fce1c8f747c62 to your computer and use it in GitHub Desktop.
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 MySuperClass { | |
private Map<String,String> values; | |
// static initializer parent | |
{ | |
values = new HashMap<String,String>(); | |
values.put( "value", "super" ); | |
} | |
public void doSomething( String s ){ | |
this.values.get( s ); // expect it to return "super" | |
} | |
} | |
public class MySubClass(){ | |
private Map<String,String> values; | |
// static initializer subclass | |
{ | |
values = new HashMap<String,String>(); | |
values.put( "value", "sub" ); | |
} | |
public void doSomething( String s ){ | |
this.values.get( s ); // expect it to return sub | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment