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 Test { | |
| public static void main(String[] args) { | |
| Test test = new Test(); | |
| } | |
| public Test() { | |
| Corgi a = (Corgi)(new TeaCupCorgi()); // Compiles and Runs | |
| Corgi b = (TeaCupCorgi)(new Corgi()); // Compiles, but doesn't Run | |
| Corgi c = new Corgi(); // Compiles (this is the "new Corgi()" portion above on line 8) |
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
| import java.awt.*; | |
| import javax.swing.*; | |
| public class Test extends JPanel { | |
| public Test() { | |
| setPreferredSize(new Dimension(400, 400)); | |
| } | |
| public static void main(String[] args) { | |
| JFrame frame = new JFrame(); |
NewerOlder