t/samples/hello_world/java/Main.java
raw| 1 | public class Main { |
| 2 | public static void main(String[] args) { |
| 3 | HelloWorld hello1 = new HelloWorld(); |
| 4 | HelloWorld hello2 = new HelloWorld(); |
| 5 | |
| 6 | hello1.say(); |
| 7 | hello2.say(); |
| 8 | |
| 9 | // Yes, I know Java does not need destructors, but I want the program to |
| 10 | // work just like the C and C++ ones, and I cannot guarantee when (or if) |
| 11 | // finalize() will be called. |
| 12 | hello1.destroy(); |
| 13 | hello2.destroy(); |
| 14 | } |
| 15 | } |