Home
Tutorials
Core Java
Introduction To Java
Java Evolution
Overview of Java
Constants, Variables and Data Types
Java Operators
Branching Statements
Looping Statements
Classes, Objects and Methods
Inheritance
Array, String and Vectors
Java Interfaces
Java Packages
Applet Programming
Graphics Programming
Advanced Java
Java AWT
Java Event Handling
Java File Handling
Java MultiThreading
Java Swing-I
Java Swing-II
Exception Handling
Socket Programming
Java Database
Java RMI
Java Servlets
Java Beans
Programms
Projects
Downloads
Contact
Java Programming
!doctype>
Finalize in Java
/* ============================================ File Name : FinalizeProgram.java WebSite : http://javaproglang.blogspot.in/ Created By : Bintu Chaudhary Email ID : bintu.chaudhary.mks@gmail.com ============================================ */ import java.io.*; class finl { int a,b,c; finl() { a = 100; b = 200; } void get() { System.out.println("Value of A and B"); } void show() { c = a + b; System.out.println("Sum="+c); } protected void finalize() { System.out.println("Memory Released by Constructor"); } } class FinalizeProgram { public static void main(String args[]) { finl obj=new finl(); obj.get(); obj.show(); obj.finalize(); } }
Output of "FinalizeProgram.java"
Download Complete Program
-
Read more »
No comments:
Post a Comment
No comments:
Post a Comment