Public class Work {public static void main (String [] args) {System. out. println ("the sorted array is:"); Sorting S = new Sorting (); S. work (); System. out. println ("Search for elements in an array"); Search S1 = new Search (); S1.search (S. xArray) ;}} public class Sorting {int xArray [] = {123,-}; int L = xArray. length; int M = 0; public void work () {for (int j = 0; j <L; j ++) {for (int I = 0; I <L-j-1; I ++) {if (xArray [I] <xArray [I + 1]) {M = xArray [I]; xArray [I] = xA Rray [I + 1]; xArray [I + 1] = M ;}}for (int I = 0; I <L; I ++) {System. out. print (xArray [I] + "") ;}} import java. util. *; public class Search {public void search (int [] xArray) {int start = 0, end, middle; System. out. println ("enter a number:"); numbers = new users (System. in); int number = bytes. nextInt (); int count = 0; int L = xArray. length; end = L; middle = (start + end)/2; while (number! = XArray [middle]) {if (number <xArray [middle]) start = middle; else if (number> xArray [middle]) end = middle; middle = (start + end)/2; count ++; if (count> L/2) break;} if (count> L/2) System. out. println (number + "not in array"); elseSystem. out. println (number + "in array ");}}