public static void main(String[] args) {
        
         System.out.print("Enter the array's length\n");
         int userNumber = sc.nextInt();

         int[] array = new int[userNumber];        
         for (int i = 0; i < userNumber; i++){
            array[i] = r.nextInt(100);
         }
         
         System.out.println(Arrays.toString(array)+"-before sorting\n"); 
         int userChoice;
        do {
            userChoice = showMenu();
            
            switch(userChoice){
                case 1: MegaSorter sort1 = new MegaSorter(new BubbleSort());
                        sort1.setDelegate(new BubbleSort());
                        sort1.sort(array);
                        System.out.println("Bubble sort is completed");
                        System.out.println(Arrays.toString(array)+"-after sorting\n");
                    break;
                case 2: MegaSorter sort2 = new MegaSorter(new MergeSort());
                        sort2.setDelegate(new MergeSort());
                        sort2.sort(array);
                        System.out.println("Merge sort is completed");
                        System.out.println(Arrays.toString(array)+"-after sorting\n");
                    break;
                
                 case 3: MegaSorter sort3 = new MegaSorter(new CountSort());
                        sort3.setDelegate(new CountSort());
                        sort3.sort(array);
                        System.out.println("Count sort is completed"); 
                        System.out.println(Arrays.toString(array)+"-after sorting\n");
                    break;
                     
                 case 4: MegaSorter sort4 = new MegaSorter(new TreeSort());
                        sort4.setDelegate(new TreeSort());
                        sort4.sort(array);
                        System.out.println("Tree sort is completed");
                        System.out.println(Arrays.toString(array)+"-after sorting\n");
                    break;
                     
                 default: break;
            }
            
        } while (userChoice != 0);
    }