I have an array of positive/negative ints
int[] numbers = new int[10];
numbers[0] = 100;
numbers[1] = -34200;
numbers[2] = 3040;
numbers[3] = 400433;
numbers[4] = 500;
numbers[5] = -100;
numbers[6] = -200;
numbers[7] = 532;
numbers[8] = 6584;
numbers[9] = -945;
and lets say i want to display a toast message when the program finds the closest value to myNum
int myNum = 600;
Is this possible? and if so how can i implement this?
P.S no i do not want to use System.out.println() as i intend on using the IF statement for something else, i just thought displaying a toast message would be the simplest thing.