text
stringlengths
14
410k
label
int32
0
9
public static Vector<Integer> SLOrestricted(GraphModel g, Vector<Integer> V) { List<Pair<Integer, Integer>> VertexDegree = new Vector<>(); Vector<Integer> Ordering = new Vector<>(); //Compute N_2-degree for all vertices in V for (int v : V) { VertexDegree.add(new Pair<>(v, Neighbors.N_2_restricte...
9
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed //ADD SEARCH STUFF HERE Search searcher = new Search(); String title = titleText.getText(); String crn = crnText.getText(); String professor = professorText.getText(); ...
8
@Override public Object evaluate(ArrayList<Context1> pila_basura) throws Exception { try{ StringBuilder output = new StringBuilder(); for (Evaluator e : lista) { if (e != null) { if (e instanceof ReturnEvaluator) { return e.evaluate(pila); } Object ob; ob = e.evaluate(pila); if (ob !...
9
public void setParent(Node<T> parent) { this.parent = parent; if (parent != null) { for (Node<T> sibling : parent.children) { if (sibling == this) { return; } } parent.children.add(this); } }
3
public String toString() { IntFraction f = simp(this); if (f.d == 0) return "Error: Denominator is zero."; else if (f.n == 0) return "0"; else if (f.d == 1) return String.valueOf((negative?"-":"") + f.n); else if (f.n < f.d) ...
7
public AntiAliasingLine(Excel ex1, Excel ex2) { begin = ex1; end = ex2; setColoredExes(); }
0
public CardListPanel() { final CardTableModel dm = new CardTableModel(); final JTable t = new JTable(dm); dm.setTable(t); t.getColumnModel().getColumn(0).setCellRenderer( new DefaultTableCellRenderer() { private static final long serialVersionUID = -9109954835956521771L; @Override public Co...
8
public void write() { if (!valid()) { System.err.println("Not saving invalid map"); return; } try { ObjectOutputStream output = new ObjectOutputStream(new FileOutputStream(filepath())); output.writeObject(this); } catch (FileNotFoundExcepti...
3
public static String protdist(String query, String model, String GammaDistrOfRates, double CoeffOfVariation, double fracOfInvSites, String oneCatOfSubRates, int noOfCat, String rateForEachCat, String categoriesFile, String UseWts4Posn, String weightsFile, String analyzeMultipleDataSe...
7
public static void changeLendability(MediaCopy mc, boolean lendable) { try { if(conn == null || conn.isClosed()){ conn = DatabaseConnection.getConnection(); } } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try{ conn.setAutoCom...
4
public void redo() { if (patchIndex >= undoPatches.size()) { return; } UndoPatch p = undoPatches.get(patchIndex++); // Perform patch int prow; for (prow = 0; prow < p.oldText.length; prow++) { if (prow >= p.patchText.length) { for (int da = p.oldText.length - prow; da > 0; da...
5
public PlotWindowView(PlotView view) { setTitle("Plot"); setSize(WIDTH, HEIGHT); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); getContentPane().add(view); view.setFocusable(true); view.requestFocus(); }
0
protected void actionPerformed(GuiButton var1) { if(var1.id == 0) { ; } if(var1.id == 1) { this.mc.thePlayer.respawnPlayer(); this.mc.displayGuiScreen((GuiScreen)null); } if(var1.id == 2) { this.mc.changeWorld1((World)null); this.mc.displayGui...
3
private void paintPictures(Graphics g){ for(int i = 0; i <4; i++){ for(int n = 0; n <4; n++){ int j = convertBase4(i, n); BufferedImage img = imageQueue.get(j); if(img != null)//img will be null if we are not online. g.drawImage(img, n*img.getWidth(), i*img.getHeight(), null); } ...
3
@Action public void deleteItem() { TreePath selectedPath = jTree1.getSelectionPath(); if (selectedPath == null) { JOptionPane.showMessageDialog(mainPanel, "Please select a category or item first", "You need a category or item", ...
7
public static void main(String[] args) { long start = System.nanoTime(); int sum = 0; for(int i = 3; i < 1000; i++){ if(i % 3 == 0 || i % 5 == 0){ sum += i; } } System.out.println(sum); System.out.println("Done in " + (double) (System.nanoTime() - start) / 1000000000 + " seconds."); }
3
public void submitAll(IntervalList intervals) { //adjust threshold to be bigger if we're dealing with genome-sized files, //elsewise we may blow the stack if (intervals.getExtent() > 1e8) { thresholdExtent = (long) 1e7; } if (intervals.getExtent() > 1e9) { thresholdExtent = (long) 1e8; } if (i...
6
@Override public int compare(Announcement announcement1, Announcement announcement2) { if (announcement1.timestamp.getTime() < announcement2.timestamp.getTime()) return 1; else if (announcement1.timestamp.getTime() > announcement2.timestamp.getTime()) return -1; else return 0; }
2
@Override public void run() { String line = ""; try { br = new BufferedReader(new InputStreamReader(new FileInputStream(file))); line = br.readLine(); //Throw away first two lines of title info line = br.readLine(); while (br.ready()) { ...
5
private String decodePapPassword(byte[] encryptedPass, byte[] sharedSecret) throws RadiusException { if (encryptedPass == null || encryptedPass.length < 16) { // PAP passwords require at least 16 bytes logger.warn("invalid Radius packet: User-Password attribute with malformed PAP password, length = " + e...
7
private void vergebeIDs(IOManager manager) { manager.readRaeume(); List<Raum> rlist = manager.getRaeume(); Set<Integer> idList = new HashSet<Integer>(); for(Raum r : rlist) { idList.add(r.getId()); } Random rand = new Random(); int newid; GridButton[][] buttons = _ui.getMap().getButtonArray(); ...
7
public String GetStringData() { return data1; }
0
private int jjMoveStringLiteralDfa9_0(long old0, long active0, long old1, long active1) { if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_0(7, old0, old1); try { curChar = input_stream.readChar(); } catch (IOException e) { jjStopStringLiteralDfa_0(8, ...
8
@Override protected void sort(int[] a) { int largest = a[0]; for (int n : a) if (largest < n) largest = n; int log = (int) Math.ceil(Math.log(largest) / Math.log(RADIX)); for (int i = 0; i < log; i++) { for (int n : a) regist...
6
public void queueLoad(Point p) { try { toLoad.put(p); } catch (InterruptedException e) { e.printStackTrace(); } }
1
public boolean checkCheckmate(Board b,int l,int o ){ aiarr=b.getBoardArray(); for(int x=0;x<8;x++){ for(int y=0;y<8;y++){ Point[] mov=canMove(new Point(x,y)); Piece [][] arr0=new Piece[8][8]; for(int x1=0;x1<8;x1++){ for(int y1=0;y1<8;y1++){ arr0[x1][y1]=aiarr[x1][y1]; } } Pie...
6
public void fillUpProductComboBox() { ArrayList<StockItem> productComboboxList = driver.getStockDB().getStockList(); comboBoxItems.clear(); itemsQuantity.clear(); itemsPrice.clear(); for (StockItem stockItem : productComboboxList) { String values[] = supplierComboBox.getSelectedItem().toString().split("...
2
@Override public String getDef() {return def;}
0
public int compareTo(Animatable other) { if (other instanceof GameOfLife) { GameOfLife o = (GameOfLife) other; if (x > o.x) return 1; else if (x < o.x) return -1; else if (y > o.y) return 1; else if (y < o.y) return -1; else if (boxSize > o.boxSize) return 1; else if (boxSize ...
9
private void close() { try { if (rs != null) { rs.close(); } if (statement != null) { statement.close(); } if (conn != null) { conn.close(); } } catch (SQLException e) { th...
4
public void onIncomingFileTransfer(DccFileTransfer transfer) { int choix = JOptionPane.showConfirmDialog(null, transfer.getNick() + " veux vous envoyer " + transfer.getFile() + ", voulez vous accepter?", transfer.getNick() +...
3
public GenericDAO<Project> getProjectsDAO() { if (_projectsDAO == null) { _projectsDAO = new GenericDAO<Project>(Project.class); } return _projectsDAO; }
1
public static void load(String path) { try { String vertexFilename = "vertex.txt"; String edgeFilename = "edges.txt"; String streetFilename = "streets.txt"; boolean isDirected = true; PreProcessingMap preProcessingMap = new PreProcessingMap(...
6
public void stopgame() { if(!running) return; running = false; synchronized(applets) { applets.remove(p); } p.interrupt(); remove(h); p = null; h = null; }
1
private static void initializeGame() { System.out.println("\n\nTHE Dot.Com GUESSING GAME"); System.out.println("--------------------------------------------------------------------------------"); System.out.println("This is a simple guessing game. There are a few web addresses hidden randomly inside " + "t...
8
private static operation getOperateur(String equation) { //cette fonction retourne un opérateur et affiche l'équation actuelle final String menu[] = {"=", "/", "*", "-", "+"}; int choix; operation op; choix = JOptionPane.showOptionDialog( null, "Quelle opéranteur voulez-vous ajouter?\n"+equation, "C...
5
private void chooseMovement(){ if (x == 49 && y == 25){ world.removeObject (hpBar); world.removeObject (dv); currentHp = 0; world.mobDie (this, true); } else{ if (x == 10 && y == 12 && stage == 0){ stage = 1; ...
8
public boolean isEmpty() { if (size == 0) { return true; } for (int i = 0; i < taulu.length; i++) { if (taulu[i] != null) { return false; } } return true; }
3
public KeyHandler(String alias) { this.alias = alias; keychain = new HashMap<String, KeyNoncePair>(); }
0
public List<Cluster> performClustering(double[][] distances , String[] clusterNames , LinkingRule linkingRule , int k , Matrix features) { /* Argument checks */ if (distances == null || distances.length == 0 || distances[0].length != distances.length) { throw new IllegalArgumentException("...
6
public String toString() { int length = 2 * ((z1[0].toString()).length()); String sidespace = ""; for(int i=0; i<length/2; i++){sidespace += " ";} String unit = "+"; String horiz = " "; String verti = " | "; String lab = ""; ...
7
private void displayPRF(String prefixStr, int correct, int guessed, int gold, int exact, int total, PrintWriter pw) { double precision = (guessed > 0 ? correct / (double) guessed : 1.0); double recall = (gold > 0 ? correct / (double) gold : 1.0); double f1 = (precision > 0.0 && recall > 0.0 ? 2.0 / (1...
4
private void processDeckClick() { //Can assume did click on the deck. final Stack<Card> deck = game.getDeck(); if (!deck.isEmpty()) { activeMove = new DeckClickMove(); String result = activeMove.makeMove(game, this); processMoveResult(result, activeMove); ...
1
public boolean equals(Object x) { // der Parameter muss vom Typ Object sein wegen der Spezifikation der Klasse Object // deswegen kann diese Methode nicht generisch genacht werden if (this == x) return true; if (x == null) return false; if (getClass() != x.getClass()) return fal...
8
public static String toString(JSONObject jo) throws JSONException { boolean b = false; Iterator keys = jo.keys(); String string; StringBuffer sb = new StringBuffer(); while (keys.hasNext()) { string = keys.next().toString(); if (!jo.isNull(s...
3
@Override public void die() { tile.getBombers().remove(this); this.tile = null; this.cooldown = match.dyingCooldown; this.points -= match.pointsLostForDying; }
0
public void resolveJumpMarkings() throws SemanticException { //scan for positions int position = 0; final Map<String, Integer> jumpAddresses = new HashMap<>(); for (final Instruction instruction : instructions) { if (jumpMarkings.containsKey(instruction)) { fi...
8
@Override public void execute(FileSearchBean task) throws Exception { final FileInputStream fileInputStream = new FileInputStream(task.getInputFile()); final BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream, bufferSize); try { int j = 0; ...
7
PhysConstantEnum(double value) { this.value = value; }
0
public int returnCoorFromXY(int x, int y) { if (x < 0 || x >= this.squaresX) { return -1; } if (y < 0 || y >= this.squaresY) { return -1; } return (x + (y * this.squaresX)); }
4
@Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Empresa)) { return false; } Empresa other = (Empresa) object; if ((this.codempresa == null && other.codempresa ...
5
public static FiniteStateAutomaton removeMultipleCharacterLabels( Automaton automaton) { FiniteStateAutomaton fsa = (FiniteStateAutomaton) automaton.clone(); Transition[] transitions = fsa.getTransitions(); for (int k = 0; k < transitions.length; k++) { FSATransition transition = (FSATransition) transitions...
2
public ArrayList<Villager> getPeople() {return this.people;}
0
@Override public boolean importData(TransferSupport support) { logger.info("importData"); if (!canImport(support)) { return false; } JTable.DropLocation dl = (JTable.DropLocation) support.getDropLocation(); int row = dl.getRow(); logger.info("Row number {}...
5
private int getNumberBySlot(int slot) { slot--; // skip this parameter (not an outer value) for (int i = 0; slot >= 0 && i < headCount; i++) { if (slot == 0) return i; slot -= head[i].getType().stackSize(); } return -1; }
3
@Override public void explore(ProcessConfiguration config, ExploringThread thread, Explorable parent) throws ExplorationException { try { ZipFile zip = (ZipFile) parent; File zipFile = zip.getPath(); File tempFolder = getTempFolder(zipFile.getName()); tempFolder.mkdirs(); if (log.isLoggable(Le...
7
private void isGreaterThanEqualsToString(String param, Object value) { if (value instanceof String) { if (param.compareTo((String) value) <= 0) { throw new IllegalStateException("String is not greater than supplied value."); } } else { throw new IllegalArgumentException(); } }
2
public String getHouseNumber() { return addressCompany.getHouseNumber(); }
0
public void shutdown() { super.shutdown(); try { workers.awaitTermination(500, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { // NOP } finally { workers.shutdownNow(); } }
1
private static void method495(char ac[]) { int i = 0; for(int j = 0; j < ac.length; j++) { if(method496(ac[j])) ac[i] = ac[j]; else ac[i] = ' '; if(i == 0 || ac[i] != ' ' || ac[i - 1] != ' ') i++; } for(int k = i; k < ac.length; k++) ac[k] = ' '; }
6
private static String parseData(String data) { if(data == null || data.length() == 0) return data; if(data.startsWith(BINARY_KEY)) return data.substring(4); // return parseHexString(data.substring(4), false); else if(data.startsWith(DWORD_KEY)) return data.substring(6); // retu...
7
@Test public void twoCompCircular3() throws Exception { try { C3 c = new C3(); fail(); } catch (RuntimeException E) { // E.printStackTrace(); // assertTrue(E.getMessage().contains("src == dest")); } }
1
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case statePackage.STATE__PLAYERS: return getPlayers(); case statePackage.STATE__COUNTRY_STATE: if (coreType) return getCountryState(); else return getCountryState().map(); case statePackage.STAT...
8
@Override public void run() { for(Object socket : sockets) { if(socket instanceof DatagramSocket) if(((DatagramSocket) socket).isClosed()) { ((DatagramSocket) socket).close(); continue; } if(socket instanceof Se...
9
public void setTree(RootedTree tree, Collection<Node> selectedNodes) { this.originalTree = tree; if (!originalTree.hasLengths()) { transformBranches = true; } Painter<?>[] pl = { taxonLabelPainter, nodeLabelPainter, branchLabelPainter }; for( Painter<?> p : pl ) { ...
7
private void updateAndClose(final String initials) { if (!closing && getDate() != null) { closing = true; try { Connection conn = MySql.getConnection(); PreparedStatement statement = conn.prepareStatement(MySql.OPENING_COUNT_UPDATE); final ...
7
public static void main(String[] args) { // Command line arguments for (String arg : args) { System.out.println(arg); } String code = "declare a transreal declare b transreal set b 1 set a + b nullity"; EsperCompiler compiler = new EsperCompiler(); compiler.readCommandLineArguments(args); compil...
1
private void initCarTypes() { this._carTypes = new CarType[4]; this._carTypes[0] = new CarType(UUID.randomUUID(), "硬座车", 1L); for(int i = 1; i <= 118; i ++) { Seat seat = new Seat(); seat.setId(UUID.randomUUID()); seat.setNumber(Integer.toString(i)); seat.setType(1L); this._carTypes[0].getSeat...
4
public boolean groupSumClump(int start, int[] nums, int target) { if (start >= nums.length) return (target == 0); int sum = nums[start]; for (int i = start; i < nums.length - 1; i++) { if (nums[i + 1] == nums[start]) { sum += nums[i]; } else { ...
8
public masterControl(){ // create main controls buttons[0] = new JButton("New"); buttons[1] = new JButton("Play/Pause"); buttons[2] = new JButton("Step"); //buttons[3] = new JButton("State Editor"); //buttons[4] = new JButton("Cell Editor"); //buttons[5] = new JButton("Cell Picker"); //buttons[6] = new ...
4
public boolean start() { synchronized (optOutLock) { // Did we opt out? if (isOptOut()) { return false; } // Is metrics already running? if (task != null) { return true; } // Begin hitting the s...
7
public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://down...
6
public String processInput(String theInput) { String theOutput = null; if (state == WAITING) { theOutput = "Knock! Knock!"; state = SENTKNOCKKNOCK; } else if (state == SENTKNOCKKNOCK) { if (theInput.equalsIgnoreCase("Who's there?")) { theOutpu...
8
public static Proposition buildMemberOfProposition(Cons tree) { Logic.verifyNumberOfPropositionArguments(tree, 2); { Stella_Object collectionref = tree.rest.rest.value; { Surrogate testValue000 = Stella_Object.safePrimaryType(collectionref); if (Surrogate.subtypeOfSurrogateP(testValue000)) { ...
7
public static void writeOSM(HashMap<Integer, CustomNode> clcMainNodes, HashMap<Integer, CustomWay> clcMainWays, HashMap<Integer, CustomRelation> clcMainRelations, String filename) { XMLOutputFactory factory = XMLOutputFactory.newInstance(); XMLStreamWriter writer; FileOutputStream stream; try { stream ...
8
private boolean executeNotRandomMusics(int indexMusic) { for(int i = indexMusic; i < getMusics().size(); i++){ getMusics().get(i).play(); if(isRamdom) return true; } return false; }
2
private void boardDraw(Graphics2D g2d) { ChessEngine game = gameThread.getGame(); g2d.drawImage(assets.getBackground(), 0, 0, null); State state = gameThread.getGameState(); if(state == State.PLAYING) { for(Piece p : game.getWhitePieces()) { drawPiece(p, g2d); } for(Piece p : game.getBlackPieces...
8
public static void Help() { GUI.log("" + "Commands:\n" + "north exit through the northern door.\n" + "east exit through the eastern door.\n" + "south exit through the southern door.\n" + "west exit through the western door.\n" + "exit go back to the main menu.\n" + "inspect get more i...
0
public RegularExpression getExpression() { return (RegularExpression) super.getObject(); }
0
private long removeRefRippleServer(long lIndex) { // // loop through the elements in the actual container, in order to find the one // at lIndex. Once it is found, then loop through the reference list and remove // the corresponding reference for that element. // RippleServer refActualElement = GetRippleServer(l...
5
private String getFieldString(Object o, int type) { if (o == null) return "null"; switch (type) { case java.sql.Types.INTEGER: return ((Integer)o).toString(); case java.sql.Types.BOOLEAN: return ((Boolean)o).toString(); case java.sql.Types.CHAR: case java.sql.Types.VARCHAR: return "'" + (String)...
9
public NChatServer(){ //Try to start connection on server port (Start.port). System.out.println("Trying to connect to port " + Start.port + "..."); try{ connectionSocket = new ServerSocket(Start.port); }catch(IOException e){ System.out.println("Error connecting to port " + Start.port + "!"); e.print...
4
private static void doTest(boolean b, String msg) { if (b) { System.out.println("Good."); } else { System.err.println(msg); } }
1
public void service(ServletRequest request,ServletResponse response) throws ServletException, IOException { String st=request.getParameter("ques"); int i=Integer.parseInt(st); String str=request.getParameter("comments"); String str1=request.getParameter("option1"); String str2=request.getParameter("option2")...
2
public static void main(String args[]) throws Throwable { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int N=parseInt(in.readLine().trim()); int[][] arr=new int[N][]; for(int i=0;i<N;i++) { StringTokenizer st=new StringTokenizer(in.readLi...
9
private static String valueLine(ArrayList<String> values, int columnSize) { String line = "|"; for(int i = 0; i < values.size(); i++) { String cell = " "; if(values.get(i).length() > columnSize-1) { cell += values.get(i).substring(0, columnSize-4); cell += ">> "; } else { cell += values....
3
public void setPosLab(String posLab) { this.posLab = posLab; }
0
@Override public boolean equals (Object other){ if(other == null) return false; if (!(other instanceof Meld)) return false; Meld otherMeld = (Meld) other; if(this.isRun != otherMeld.isRun) return false; if(this.getNumTiles() != otherMeld.getNumTiles()) return false; ArrayList<Tile> myTile...
6
public ExtendableClassLoader() { cache = new Hashtable<String, Class<?>>(); paths = new ArrayList<String>(); }
1
private void loadDictionary() throws IOException, FileNotFoundException{ BufferedReader in = null; try { in = new BufferedReader(new FileReader(WORDS_FILE)); String word; while ((word = in.readLine()) != null) { dictionary.add(word.trim().toLowerCase()); } in.close(); } catch (FileNotFoundExcep...
5
private static String TranslateEnumToContentType(ContentType contentType){ switch(contentType){ case RDF: return "application/rdf+xml"; case TURTLE: return "application/x-turtle"; case NT: return "text/plain"; case N3: return "text/rdf+n3"; default: return "text/plain"; } }
4
public static void main(String[] args) { int port; if (args.length != 2) { System.err.println("Usage: java ChatServer <port> <database name>"); return; } try { port = Integer.parseInt(args[0]); } catch (NumberFormatException nfe) { System.err.println("Usage: java ChatServer <port>"); return;...
5
public float getI() { float input = 0f; for (int j = 0; j < inputs.size(); j++) { FiringState fired = inputs.get(j).getFired(); //fired == null indicates an External Connection which do not fire) if (fired == FiringState.DISABLED) { input += activatio...
4
public static Scriptable jsConstructor(Context cx, Object[] args, Function ctorObj, boolean inNewExpr) { Font f = new Font(); String font = cx.toString(args[0]); if (font.startsWith("data:")) { URI dataUri = null; ...
7
private int getOffset(TimeZone zone, long millis) { Date date = new Date(millis); if (zone.inDaylightTime(date)) { return zone.getRawOffset() + 3600000; } return zone.getRawOffset(); }
1
private void selectAndSpillValue() { Value spill = null; int maxEdges = 0; for(Entry<Value, HashSet<Value>> v : adjacencyList.entrySet()) { if(v.getValue().size() > maxEdges) { spill = v.getKey(); maxEdges = v.getValue().size(); } ...
2
private CharSequence getExpectedActionString(InputOutputEventType expectedEventType) { if (expectedEventType == InputOutputEventType.HALT) { return new HaltEvent().getExpectedActionDescription(); } else if (expectedEventType == InputOutputEventType.INPUT) { return new InputEvent(...
3
public static String vectorPlaceToHTML(Vector<Place> rs){ if (rs.isEmpty()) return "<p class=\"plusbas\">Il n'y a plus de places disponibles.</p>"; String toReturn = "<TABLE BORDER='1' width=\"1000\">"; toReturn+="<CAPTION>Les places disponibles (#) sont :</CAPTION>"; int i=0; for (int j=1;j<=10;j++){ ...
6
public static void main(String[] args) { if (0 == args.length) { System.out.println("Invalid input parameter"); return; } String param = args[0]; if (param.equals(RECORD)) { System.out.println("User selected RECORD"); /****** RECORD SOUND *********/ final Record dataRecorder = new Record(); ...
6
public static ArrayList<Student> sortMenu(ArrayList<Student> inList){ int choice = 0; do { System.out.println("What would you like to do: \n 1) Sort by Last Name \n 2) Sort by GPA \n 3) Sort BY Class \n 4) Return to main menu"); Scanner userinput = new Scanner(System.in); choice = userinput.nex...
5