Results 1 to 1 of 1
-
Demonstration of a simple constructor
Java Code:class Rock { Rock() { // This is the constructor System.out.println("Creating Rock"); } } public class SimpleConstructor { public static void main(String[] args) { for (int i = 0; i < 10; i++) new Rock(); } }"The sole cause of man’s unhappiness is that he does not know how to stay quietly in his room." - Blaise Pascal
Similar Threads
-
Demonstration of both constructor and ordinary method overloading
By Java Tip in forum java.langReplies: 0Last Post: 04-17-2008, 07:43 PM -
Simple demonstration of HashMap
By Java Tip in forum java.langReplies: 0Last Post: 04-12-2008, 08:48 PM -
Ftp client demonstration
By Java Tip in forum java.netReplies: 0Last Post: 04-07-2008, 08:11 PM -
Calling constructor of parent class from a constructor
By Java Tip in forum Java TipReplies: 0Last Post: 12-19-2007, 09:10 AM -
Calling constructor of same class from a constructor
By Java Tip in forum Java TipReplies: 0Last Post: 12-19-2007, 09:01 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks