Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Pisang {
- /**
- * @param args the command line arguments
- */
- public void finalize() {
- System.out.println("Garbage Collector Berhasil Terkumpul");
- }
- //Akan ditampilkan jika Garbage Collector bekerja
- public static void main(String[] okedroid) {
- /*1*/Pisang satu = new Pisang();
- /*2*/Pisang dua = new Pisang();
- /*3*/Pisang tiga = satu;
- /*4*/satu = null;
- /*5*/dua = null;
- /*6*/System.gc();
- System.out.println("Gargabe Collector Siap !");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement