I have below five Integer variables and during the program, they are assigned some values randomly. I want to get the largest variable name but not the variable value. And I want to know if at least two of them have the same value. Please provide an example. Thank you.
int politics_counter = 0;
int economics_counter = 0;
int foreign_counter = 0;
int sport_counter = 0;
int weather_counter = 0;
And now for an answer (kind of)
and now for a more interesting answer:
which will interrogate an object and show the largest field, given that the object has members that are all Integers and that are all accessible to this method. There’s a way to fudge that and improve it to make it more “robust”.