I have a program that I am writing and I have it completed but I keep receiving an error in a counter that I am using. The purpose of the program is to build a plate stacker and I have finished that but need to write a counter based on the particular colors used (how many green plates...etc.). As I know several classmates use this site to cheat, I will not post the code in whole but only the fragments I feel are necessary. Below is an example of a statement that I am using to attempt to get a count of the beige plates in the text file. The statement is in a while loop with the other colors having the same coding. I also have initialized the counter (int beige = 0;) prior to this and outside of the while loop:
if(line == "beige")
{
beige++;
}
I have a System.out following these statements to display the count but it always comes up as 0 so I believe the problem is in this particular fragment. If I need to send additional coding I will but I believe it is something to do with this or the placement of it in the while loop.