File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Fix an infity loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Fix an infity loop" Watch "Fix an infity loop" New topic
Author

Fix an infity loop

Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

Hello,

I need to create 20 objects of Class B, using while loop in class A. In class B i have a variable that should increment each time an object is created, how i should build class B's cunstractor so each time that variable increase and not become zero?
Pavan Kumar Dittakavi
Ranch Hand

Joined: Feb 12, 2011
Posts: 104

Use a static variable!
Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

Thank you
 
 
subject: Fix an infity loop
 
Similar Threads
declaring variables
While Loop Mystery...
Variable declaration
volatile variables doubt
a final variable declared in a while loop