Created
June 12, 2014 16:37
-
-
Save meyerzinn/3bb2ba9736b63570ace6 to your computer and use it in GitHub Desktop.
OverridingTest
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
package inheritance; | |
public class OverridingTest { | |
public static void main(String[] args) { | |
Message message = new Message(); | |
message.setMaxSize(1000); | |
message.setTimestamp(System.currentTimeMillis()); | |
message.printMessage(); | |
TextMessage textMessage = new TextMessage(); | |
textMessage.setMaxSize(10000); | |
textMessage.setTimestamp(System.currentTimeMillis()); | |
textMessage.setText("This is a message."); | |
textMessage.printMessage(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment