Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

New to Java--Loop exit

807599Apr 2 2007 — edited Apr 2 2007
OK, now I am using a loop and cannot get it to exit. I typed it in the same as I did my last program and it worked fine, what am I missing here?
	do {
		System.out.println ( "Please enter product #, type stop to exit" );
		productNum = input.next();
		System.out.println ( "Please enter color name" );
		name = input.next();
		System.out.println ( "Please enter units on hand" );
		units = input.nextInt();
		System.out.println ( "Please enter dollar amount for each unit" ); 
		amount = input.nextDouble();
	
		scrapbook.addAlbum(productNum, name, units, amount);
		}while (! productNum.equals ("stop"));
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2007
Added on Apr 2 2007
3 comments
226 views