Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Java
Salesman[] salesTeam = new Salesman[number];
        
        salesTeam[0] = new Salesman();
        salesTeam[1] = new Salesman();
        
        salesTeam[0].setName("A");
        salesTeam[1].setName("B");
        salesTeam[0].setSales(50);
        salesTeam[1].setSales(100);


Ends having having both values as "B" and "100"

Why is this?

I can provide more info if needed, but I feel like the issue is within this code.
Posted
Updated 12-May-14 19:14pm
v2
Comments
dan!sh 13-May-14 1:19am    
Take a look at methods that are called. From this code, it is a little tough to identify problem. I recommend debugging what is going on in these methods.

1 solution

The fields in the class were set to static.
 
Share this answer
 
Comments
TorstenH. 13-May-14 2:41am    
good - you worked on it and figured it out -> +5 for that!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900