Wrong output when printing out from an array (JAVA)
By
CreepyPro
in Programming
in Programming
Go to solution
Solved by Ominous,
Remove the static from:
private static String recipient;
Static means that recipient has the same value for all instances of the class. You're overwriting the variable every time you called the constructor which is why it's always the name of the last person in the cards array.
-
Featured Topics
-
Topics
-
PatRed ·
Posted in New Builds and Planning0 -
0
-
Manv2000 ·
Posted in Troubleshooting0 -
8
-
QMalcolm ·
Posted in General Discussion2 -
FrozenHydrangea ·
Posted in Troubleshooting1 -
LingoInv ·
Posted in Graphics Cards1 -
0
-
4
-
13
-
-
play_circle_filled
Latest From Linus Tech Tips:
I Am Not Buying A Super Computer - WAN Show May 3, 2024
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now