redletterrocko
Programmer
Alright, I'm COMPLETELY new to Java. I went and bought one of those "Learn Java in 60 seconds!" kind of books, and am trying to develop a quick piece of software in it, just to see if it's something I should continue with. I know very little, so you'll have to talk VERY SLOWLY...
So I have created multiple instances of an object (we'll call them Handgun1, Handgun2, Handgun3, etc) Each has a boolean attribute we'll call "Loaded" I would like to create a very simple procedure that would check all instances and see if Loaded=1, and if it does, to print something like "Handgun1 is loaded" to the console. The program itself is pretty simple other than that. Could someone at least point me in the right direction. I'm pretty lost... I'm assuming it would have to loop for each instance, but maybe you can come up with something better.
So I have created multiple instances of an object (we'll call them Handgun1, Handgun2, Handgun3, etc) Each has a boolean attribute we'll call "Loaded" I would like to create a very simple procedure that would check all instances and see if Loaded=1, and if it does, to print something like "Handgun1 is loaded" to the console. The program itself is pretty simple other than that. Could someone at least point me in the right direction. I'm pretty lost... I'm assuming it would have to loop for each instance, but maybe you can come up with something better.