RenzCutie

ArrayManager

Oct 1st, 2021 (edited)
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 24.35 KB | None | 0 0
  1. import java.io.IOException;
  2. import java.util.Scanner;
  3.  
  4. public class Array {
  5.     // instance variables - replace the example below with your own
  6.  
  7.     public static int MaxW = 50;
  8.     public static String Brdr = "|";
  9.     public static int[] IntArray = null;
  10.     public static int IntArraySize = 0;
  11.     public static int tmpInArrSz = -1;
  12.     public static int[] tmpIntBlnk = null;
  13.     public static int DelayMS = 1500;
  14.     public static int CurrIndx = -1;
  15.  
  16.     public static void main(String[] args) {
  17.         /*
  18.          * Minimum width: 70 characters
  19.          */
  20.         MainMenu();
  21.  
  22.     }
  23.  
  24.     public static void MainMenu() {
  25.         while (true) {
  26.             clear();
  27.             println(strLine("="));
  28.             println(strCenter(50, "Array Operations", "||"));
  29.             println(strCenter(50, "Menu", "||"));
  30.             println(strLine("="));
  31.             println(strLeft("[1] Create Array", 2));
  32.             println(strLeft("[2] Insert Elements", 2));
  33.             println(strLeft("[3] Search", 2));
  34.             println(strLeft("[4] Display", 2));
  35.             println(strLeft("[5] Delete", 2));
  36.             println(strLeft("[0] Stop", 2));
  37.             println(strLine("_"));
  38.  
  39.             Scanner in = new Scanner(System.in);
  40.             print("\n  Enter Choice: ");
  41.  
  42.             if (in.hasNextInt()) {
  43.                 int valIn = in.nextInt();
  44.                 if (0 <= valIn && valIn <= 5) {
  45.                     switch (valIn) {
  46.                         case 0:
  47.                             System.exit(0);
  48.                             break;
  49.                         case 1:
  50.                             if (IntArray == null) {
  51.                                 CreateArray();
  52.                                 break;
  53.                             } else {
  54.                                 errormsg("Array already created");
  55.                                 continue;
  56.                             }
  57.                         case 2:
  58.                             if (CurrIndx == -2) {
  59.                                 if (arrTmpCnt() != IntArraySize) {
  60.                                     InsertElements2();
  61.                                     break;
  62.                                 } else {
  63.                                     errormsg("User already inserted elements");
  64.                                     continue;
  65.                                 }
  66.                             } else if (IntArray == null) {
  67.                                 errormsg("Create array first");
  68.                                 continue;
  69.                             } else {
  70.                                 InsertElements();
  71.                                 break;
  72.                             }
  73.                         case 3:
  74.                             if (IntArray == null) {
  75.                                 errormsg("Create array first");
  76.                                 continue;
  77.                             } else if (CurrIndx != -2) {
  78.                                 errormsg("Insert elements first");
  79.                                 continue;
  80.                             } else {
  81.                                 Search();
  82.                                 break;
  83.                             }
  84.                         case 4:
  85.                             if (IntArray == null) {
  86.                                 errormsg("Create array first");
  87.                                 continue;
  88.                             } else if (CurrIndx != -2) {
  89.                                 errormsg("Insert elements first");
  90.                                 continue;
  91.                             } else {
  92.                                 Display();
  93.                                 break;
  94.                             }
  95.                         case 5:
  96.                             if (tmpInArrSz == 0) {
  97.                                 errormsg("Array was already empty");
  98.                                 continue;
  99.                             } else if (CurrIndx != -2) {
  100.                                 errormsg("Complete the array values first");
  101.                                 continue;
  102.                             } else {
  103.                                 Delete();
  104.                                 break;
  105.                             }
  106.                     }
  107.                     in.close();
  108.                     break;
  109.                 } else {
  110.                     errormsg("Please enter numbers 0 - 5 only");
  111.                     continue;
  112.                 }
  113.             } else {
  114.                 errormsg("Please enter numbers only");
  115.                 continue;
  116.             }
  117.  
  118.         }
  119.  
  120.     }
  121.  
  122.     public static void CreateArray() {
  123.         while (true) {
  124.             clear();
  125.             println(strLine("="));
  126.             println(strCenter(50, "Create Array", "||"));
  127.             println(strLine("="));
  128.             println(strLeft("Maximum size of 5", 2));
  129.             println(strLeft("Minimum size of 20", 2));
  130.             println(strLine("_"));
  131.             print("\n  Enter size of array: ");
  132.  
  133.             Scanner in = new Scanner(System.in);
  134.  
  135.             if (in.hasNextInt()) {
  136.                 IntArraySize = in.nextInt();
  137.                 if (IntArraySize >= 5 && IntArraySize <= 20) {
  138.                     IntArray = new int[IntArraySize];
  139.                     tmpIntBlnk = new int[IntArraySize];
  140.                     println("");
  141.  
  142.                     msg("Attention!\nYou have created " + IntArraySize + " arrays.");
  143.                     MainMenu();
  144.  
  145.                     in.close();
  146.                     break;
  147.                 } else {
  148.                     errormsg("Please enter numbers 5 - 20 only");
  149.                 }
  150.             } else {
  151.                 errormsg("Please enter numbers only");
  152.             }
  153.             continue;
  154.         }
  155.     }
  156.  
  157.     public static void inElPrnt(int[] tmpArray) {
  158.         clear();
  159.         println(strLine("="));
  160.         println(strCenter(50, "Insert Elements", "||"));
  161.         println(strLine("="));
  162.         println(strLeft("Values inside the array:", 2));
  163.         shwTbl(tmpArray, true, true);
  164.         println(strLine("_"));
  165.         println(strLeft("Insert " + IntArraySize + " integers", 2));
  166.         println(strLeft("Enter -99 to terminate", 2));
  167.         println(strLine("_"));
  168.     }
  169.  
  170.     public static void InsertElements() {
  171.         clear();
  172.         Scanner in = new Scanner(System.in);
  173.         int tmpArray[] = arrCpy(IntArray);
  174.         int itmp = 0;
  175.  
  176.         if (CurrIndx != -1)
  177.             itmp = CurrIndx;
  178.  
  179.         for (int i = itmp; i < IntArraySize; i++) {
  180.             String con = "";
  181.             boolean loop = true;
  182.             int input = -1;
  183.  
  184.             while (loop) {
  185.                 inElPrnt(tmpArray);
  186.                 print("\n  " + strOrdinal((i + 1)) + " integer value at [" + (i) + "] index: ");
  187.  
  188.                 if (in.hasNextInt()) {
  189.                     input = in.nextInt();
  190.                     if (input == -99) {
  191.                         println("");
  192.                         loop = false;
  193.                         break;
  194.                     }
  195.  
  196.                     if (srch(tmpArray, input) != -1) {
  197.                         errormsg("Duplicated!");
  198.                         continue;
  199.                     } else {
  200.                         tmpArray[i] = input;
  201.                         if (i == IntArraySize - 1) {
  202.                             CurrIndx = -2;
  203.                             IntArray = arrCpy(tmpArray);
  204.  
  205.                             inElPrnt(tmpArray);
  206.                             println("\n");
  207.                             msg("Successfully inserted");
  208.                             arrTmpCnt();
  209.  
  210.                             loop = false;
  211.                         }
  212.                     }
  213.  
  214.                 } else {
  215.                     errormsg("Please enter numbers only");
  216.  
  217.                     in.next();
  218.                     continue;
  219.                 }
  220.                 break;
  221.             }
  222.  
  223.             if (input == -99) {
  224.                 msg("Are you sure want to leave?");
  225.                 println(strLeft("[y] Discard changes and leave", 2));
  226.                 println(strLeft("[n] Cancel", 2));
  227.                 println(strLeft("[c] Continue Later", 2));
  228.                 println(strLine("_"));
  229.                 print("\n  Please choose:");
  230.  
  231.                 input = -1;
  232.                 con = in.next().toLowerCase();
  233.                 if (con.equals("n")) {
  234.                     i = i - 1;
  235.                     loop = true;
  236.                     CurrIndx = -1;
  237.                     continue;
  238.                 } else if (con.equals("y")) {
  239.                     loop = false;
  240.                     CurrIndx = -1;
  241.  
  242.                     inElPrnt(tmpArray);
  243.                     println("\n");
  244.                     msg("Terminated by the user");
  245.                     break;
  246.                 } else if (con.equals("c")) {
  247.                     loop = false;
  248.                     CurrIndx = i;
  249.                     IntArray = arrCpy(tmpArray);
  250.  
  251.                     inElPrnt(tmpArray);
  252.                     println("\n");
  253.                     msg("Saved by the user");
  254.                     arrTmpCnt();
  255.                     break;
  256.                 } else {
  257.                     errormsg("Insert y, n, and c only.");
  258.                     println(strLeft("Please try a again", 2));
  259.                     println(strLine("_"));
  260.                     sleep(1500);
  261.  
  262.                     i = i - 1;
  263.                     CurrIndx = -1;
  264.                     loop = true;
  265.                     continue;
  266.                 }
  267.  
  268.             }
  269.  
  270.         }
  271.         MainMenu();
  272.         in.close();
  273.     }
  274.  
  275.     public static void InsertElements2() {
  276.         clear();
  277.         arrTmpCnt();
  278.         Scanner in = new Scanner(System.in);
  279.         int tmpArray[] = arrCpy(IntArray);
  280.         int itmp = 0;
  281.  
  282.         while (itmp < (IntArraySize - arrTmpCnt())) {
  283.             int i = tmpIntBlnk[itmp];
  284.             String con = "";
  285.             boolean loop = true;
  286.             int input = -1;
  287.  
  288.             while (loop) {
  289.  
  290.                 inElPrnt(tmpArray);
  291.                 print("\n  " + strOrdinal((i + 1)) + " integer value at [" + (i) + "] index: ");
  292.  
  293.                 if (in.hasNextInt()) {
  294.                     input = in.nextInt();
  295.                     if (input == -99) {
  296.                         loop = true;
  297.                         break;
  298.                     }
  299.  
  300.                     if (srch(tmpArray, input) != -1) {
  301.                         errormsg("Duplicated!");
  302.                         continue;
  303.                     } else {
  304.                         tmpArray[i] = input;
  305.                         if (i == (IntArraySize - arrTmpCnt() - 1)) {
  306.  
  307.                             IntArray = arrCpy(tmpArray);
  308.                             inElPrnt(tmpArray);
  309.                             println("\n");
  310.                             msg("Successfully inserted");
  311.  
  312.                             arrTmpCnt();
  313.                             loop = false;
  314.                         }
  315.  
  316.                     itmp++;
  317.                     }
  318.  
  319.                 } else {
  320.                     errormsg("Please enter numbers only");
  321.  
  322.                     in.next();
  323.                     continue;
  324.                 }
  325.                 break;
  326.             }
  327.  
  328.             if (input == -99) {
  329.                 msg("Are you sure want to leave?");
  330.                 println(strLeft("[y] Discard changes and leave", 2));
  331.                 println(strLeft("[n] Cancel", 2));
  332.                 println(strLine("_"));
  333.                 print("\n  Please choose:");
  334.  
  335.                 input = -1;
  336.                 con = in.next().toLowerCase();
  337.                 if (con.equals("n")) {
  338.                     loop = true;
  339.                     continue;
  340.                 } else if (con.equals("y")) {
  341.                     loop = false;
  342.                     inElPrnt(tmpArray);
  343.                     println("\n");
  344.  
  345.                     msg("Terminated by the user");
  346.                     break;
  347.                 } else {
  348.                     errormsg("Insert y and n only.");
  349.                     println(strLeft("Please try a again", 2));
  350.                     println(strLine("_"));
  351.                     sleep(1500);
  352.  
  353.                     loop = true;
  354.                     continue;
  355.                 }
  356.  
  357.             }
  358.  
  359.         }
  360.         MainMenu();
  361.         in.close();
  362.     }
  363.  
  364.     public static void srchPrnts() {
  365.         clear();
  366.         println(strLine("="));
  367.         println(strCenter(50, "Search", "||"));
  368.         println(strLine("="));
  369.         println(strLeft("Enter the integer search key you want", 2));
  370.         println(strLeft("to find below inside the Array", 2));
  371.     }
  372.  
  373.     public static void Search() {
  374.         Scanner in = new Scanner(System.in);
  375.         int tmpArray[] = arrCpy(IntArray);
  376.  
  377.         while (true) {
  378.             srchPrnts();
  379.             println(strLine("_"));
  380.  
  381.             print("\n  Enter the integer: ");
  382.             int input = (int) (in.nextInt());
  383.  
  384.             if (input == -99) {
  385.                 errormsg("Forbidden");
  386.                 continue;
  387.             }
  388.  
  389.             int searchIn = srch(IntArray, input);
  390.             if (searchIn == -1) {
  391.                 srchPrnts();
  392.                 println(strLine("_"));
  393.  
  394.                 println(strLeft("Values inside the array:", 2));
  395.                 shwTbl(tmpArray, false, false);
  396.                 println(strLine("_"));
  397.                 println("\n");
  398.                 msg("Integer (" + input + ") was not found\nin the array!");
  399.                 sleep(1000);
  400.                 break;
  401.             } else {
  402.                 srchPrnts();
  403.  
  404.                 tmpArray[searchIn] = -99;
  405.                 println(strLine("_"));
  406.  
  407.                 println(strLeft("Values inside the array:", 2));
  408.                 shwTbl(tmpArray, true, false);
  409.                 println(strLine("_"));
  410.  
  411.                 println("\n");
  412.                 msg("Integer (" + input + ") was found at\nindex (" + Integer.toString(searchIn) + ") of the array!");
  413.                 sleep(2000);
  414.  
  415.                 break;
  416.             }
  417.  
  418.         }
  419.         MainMenu();
  420.         in.close();
  421.     }
  422.  
  423.     public static void Display() {
  424.  
  425.         clear();
  426.         println(strLine("="));
  427.         println(strCenter(50, "Display", "||"));
  428.         println(strLine("="));
  429.         println(strLeft("Values inside the array:", 2));
  430.  
  431.         shwTbl(IntArray, false, true);
  432.         println(strLine("_"));
  433.  
  434.         sleep(2500);
  435.         MainMenu();
  436.  
  437.     }
  438.  
  439.     public static void prntDel(int[] tmpArray, boolean hide) {
  440.         clear();
  441.         println(strLine("="));
  442.         println(strCenter(50, "Delete", "||"));
  443.         println(strLine("="));
  444.         println(strLeft("Values inside the array:", 2));
  445.  
  446.         shwTbl(tmpArray, true, hide);
  447.  
  448.         println(strLine("_"));
  449.         println(strLeft("Insert the value(s) of the element(s)", 2));
  450.         println(strLeft("you want to be deleted", 2));
  451.         println(strLine("_"));
  452.     }
  453.  
  454.     public static void shwTbl(int[] arry, boolean tmp, boolean hide) {
  455.         int a = 0;
  456.         String strFnl = "";
  457.         String tmpS = "";
  458.         while (a < IntArraySize) {
  459.             if (tmp)
  460.                 if (IntArray[a] == -99)
  461.                     tmpS = "0";
  462.                 else
  463.                     tmpS = "[" + Integer.toString(IntArray[a]) + "]";
  464.             else
  465.                 tmpS = Integer.toString(arry[a]);
  466.  
  467.             if (arry[a] == -99)
  468.                 if (hide)
  469.                     strFnl = strFnl + strLeft(9, "0", "", 1);
  470.                 else
  471.                     strFnl = strFnl + strLeft(9, tmpS, "", 1);
  472.             else
  473.                 strFnl = strFnl + strLeft(9, Integer.toString(arry[a]), "", 1);
  474.             if (a % 5 == 4) {
  475.                 println(strLeft(strFnl, 1));
  476.                 strFnl = "";
  477.             }
  478.             a++;
  479.         }
  480.  
  481.         if (!strFnl.equals(""))
  482.             println(strLeft(strFnl, 1));
  483.     }
  484.  
  485.     public static void Delete() {
  486.         int inInt = -1;
  487.         int inCnt = -1;
  488.         int tmpArray[] = arrCpy(IntArray);
  489.         Scanner in = new Scanner(System.in);
  490.  
  491.         while (true) {
  492.  
  493.             prntDel(tmpArray, false);
  494.             if (inInt == -1)
  495.                 print("\n  Number of elements to be deleted: ");
  496.  
  497.             if (in.hasNextInt()) {
  498.  
  499.                 if (inCnt == -1)
  500.                     inInt = (int) (in.nextInt());
  501.                 inCnt = 0;
  502.  
  503.                 if (inInt > arrTmpCnt()) {
  504.                     errormsg("Only " + arrTmpCnt() + " integers are allowed");
  505.                     inInt = -1;
  506.                     inCnt = -1;
  507.                     continue;
  508.  
  509.                 }
  510.  
  511.                 while (inCnt < inInt) {
  512.                     clear();
  513.                     prntDel(tmpArray, false);
  514.                     if (inInt == 1)
  515.                         print("\n  Insert the integer to be removed: ");
  516.                     else
  517.                         print("\n  Insert the " + strOrdinal(inCnt + 1) + " integer to be removed: ");
  518.  
  519.                     if (in.hasNextInt()) {
  520.                         int input = (int) (in.nextInt());
  521.                         int searchIn = srch(tmpArray, input);
  522.                         if (input == -99) {
  523.                             errormsg("Forbidden");
  524.                             continue;
  525.                         }else if (input < 1) {
  526.                             errormsg("Negative integers are prohibited");
  527.                             continue;
  528.                         }
  529.  
  530.                         if (searchIn == -1) {
  531.  
  532.                             errormsg("Integer (" + input + ") was not found in the array!");
  533.  
  534.                             continue;
  535.                         } else {
  536.                             tmpArray[searchIn] = -99;
  537.                             inCnt++;
  538.  
  539.                             while (inCnt == inInt) {
  540.  
  541.                                 prntDel(tmpArray, false);
  542.                                 println("\n");
  543.                                 msg("Do you really want to remove\nthe highlighted items?");
  544.                                 println(strLeft("[y] Discard changes and leave", 2));
  545.                                 println(strLeft("[n] Cancel", 2));
  546.                                 println(strLine("_"));
  547.                                 print("\n  Please choose:");
  548.  
  549.                                 input = -1;
  550.                                 String con = in.next().toLowerCase();
  551.                                 if (con.equals("n")) {
  552.                                     prntDel(IntArray, true);
  553.                                     println("\n");
  554.                                     msg("User cancelled the removal");
  555.  
  556.                                     arrTmpCnt();
  557.                                     break;
  558.                                 } else if (con.equals("y")) {
  559.                                     IntArray = arrCpy(tmpArray);
  560.                                     prntDel(tmpArray, true);
  561.                                     println("\n");
  562.                                     msg("Successfully removed");
  563.  
  564.                                     arrTmpCnt();
  565.                                     break;
  566.                                 } else {
  567.                                     errormsg("Insert y and n only.");
  568.                                     println(strLeft("Please try a again", 2));
  569.                                     println(strLine("_"));
  570.                                     sleep(1500);
  571.  
  572.                                     continue;
  573.                                 }
  574.  
  575.                             }
  576.                             continue;
  577.  
  578.                         }
  579.                     } else {
  580.                         errormsg("Please enter numbers only");
  581.  
  582.                         in.next();
  583.                         continue;
  584.                     }
  585.                 }
  586.             } else {
  587.                 errormsg("Please enter numbers only");
  588.  
  589.                 in.next();
  590.                 continue;
  591.             }
  592.  
  593.             MainMenu();
  594.             in.close();
  595.         }
  596.     }
  597.  
  598.     public static int srch(int[] lst, int num) {
  599.         int len = lst.length;
  600.         int tmpIndx = -1;
  601.  
  602.         for (int i = 0; i < len; i++)
  603.             if (lst[i] == num) {
  604.                 tmpIndx = i;
  605.                 break;
  606.             }
  607.  
  608.         return tmpIndx;
  609.     }
  610.  
  611.     public static void msg(String msg) {
  612.         String msgs[] = msg.split("\r\n|\n|\r");
  613.  
  614.         println(strLine(50, "=", "||"));
  615.  
  616.         for (int i = 0; i < msgs.length; i++) {
  617.             println(strCenter(50, msgs[i], "||"));
  618.         }
  619.  
  620.         println(strLine(50, "=", "||"));
  621.         sleep(DelayMS);
  622.     }
  623.  
  624.     public static void errormsg(String msg) {
  625.         clear();
  626.         println(strLine(50, "=", "||"));
  627.         println(strCenter(50, "ERROR!!", "||"));
  628.         println(strCenter(50, msg, "||"));
  629.         println(strLine(50, "=", "||"));
  630.         sleep(DelayMS);
  631.     }
  632.  
  633.     public static void sleep(int msec) {
  634.         try {
  635.             Thread.sleep(msec);
  636.         } catch (InterruptedException ex) {
  637.             Thread.currentThread().interrupt();
  638.         }
  639.     }
  640.  
  641.     public static int[] arrCpy(int[] frm) {
  642.         int[] newInt = new int[frm.length];
  643.         for (int i = 0; i < frm.length; i++)
  644.             newInt[i] = frm[i];
  645.         return newInt;
  646.     }
  647.  
  648.     public static int arrTmpCnt() {
  649.         int cnt = 0;
  650.         for (int i = 0; i < IntArray.length; i++)
  651.             if (IntArray[i] == -99) {
  652.                 tmpIntBlnk[cnt] = i;
  653.                 cnt++;
  654.             }
  655.         tmpInArrSz = IntArraySize - cnt;
  656.         return tmpInArrSz;
  657.     }
  658.  
  659.     public static int arrCntZ() {
  660.         int cnt = 0;
  661.         for (int i = 0; i < IntArray.length; i++)
  662.             if (IntArray[i] == 0) {
  663.                 cnt++;
  664.             }
  665.         return cnt;
  666.     }
  667.  
  668.     public static String strOrdinal(int num) {
  669.         int a = num % 100, b = num % 10;
  670.         String ord = "";
  671.         if (a != 11 && b == 1)
  672.             ord = "st";
  673.         else if (a != 12 && b == 2)
  674.             ord = "nd";
  675.         else if (a != 13 && b == 3)
  676.             ord = "rd";
  677.         else
  678.             ord = "th";
  679.         return Integer.toString(num) + ord;
  680.     }
  681.  
  682.     public static String strLeft(int wdth, String str, String edg, int pdng) {
  683.         double spcL = (double) (wdth - pdng - str.length() - edg.length() * 2);
  684.  
  685.         String spc2 = " ".repeat((int) (spcL));
  686.         String spc1 = " ".repeat(pdng);
  687.  
  688.         String fnl = edg + spc1 + str + spc2 + edg;
  689.         return fnl;
  690.     }
  691.  
  692.     public static String strLeft(String str, int pdng) {
  693.         double spcL = (double) (MaxW - pdng - str.length() - Brdr.length() * 2);
  694.  
  695.         String spc2 = " ".repeat((int) spcL);
  696.         String spc1 = " ".repeat(pdng);
  697.  
  698.         String fnl = Brdr + spc1 + str + spc2 + Brdr;
  699.         return fnl;
  700.     }
  701.  
  702.     public static String strCenter(String str) {
  703.         double spcL = (double) (MaxW - str.length() - Brdr.length() * 2);
  704.         double spcD = (double) spcL / 2;
  705.  
  706.         String add = "";
  707.         if (spcL % 2 != 0)
  708.             add = " ";
  709.         String spc = " ".repeat((int) Math.floor(spcD));
  710.  
  711.         String fnl = Brdr + spc + str + spc + add + Brdr;
  712.         return fnl;
  713.     }
  714.  
  715.     public static String strCenter(int wdth, String str, String edg) {
  716.         double spcL = (double) (wdth - str.length() - edg.length() * 2);
  717.         double spcD = (double) spcL / 2;
  718.  
  719.         String add = "";
  720.         if (spcL % 2 != 0)
  721.             add = " ";
  722.         String spc = " ".repeat((int) Math.floor(spcD));
  723.  
  724.         String fnl = edg + spc + str + spc + add + edg;
  725.         return fnl;
  726.     }
  727.  
  728.     public static String strLine(int wdth, String str, String edg) {
  729.         String ln = str.repeat(wdth - edg.length() * 2);
  730.         return edg + ln + edg;
  731.     }
  732.  
  733.     public static String strLine(String str) {
  734.         String ln = str.repeat(MaxW - Brdr.length() * 2);
  735.         return Brdr + ln + Brdr;
  736.     }
  737.  
  738.     public static void println(String str) {
  739.         System.out.println(str);
  740.     }
  741.  
  742.     public static void print(String str) {
  743.         System.out.print(str);
  744.     }
  745.  
  746.     public static void clear() {
  747.         // Clears Screen in java
  748.         try {
  749.             if (System.getProperty("os.name").contains("Windows"))
  750.                 new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
  751.             else
  752.                 new ProcessBuilder("clear").inheritIO().start().waitFor();
  753.         } catch (IOException | InterruptedException ex) {
  754.         }
  755.     }
  756.  
  757. }
Add Comment
Please, Sign In to add comment