fork download
  1.  
  2. if(currentTutor == null) {
  3. throw new ShellError("Error! no tutor exists");
  4. } else if(commandSplit[1].matches("\\d+")) {
  5. throw new ShellError("Error! a name doesn't have number(s)");
  6. } else if(!commandSplit[2].matches("\\d+")) {
  7. throw new ShellError("Error! a matnr. doesn't have letter(s)");
  8. } else if(prakto.findStudent(Integer.parseInt(commandSplit[2])) != null) {
  9. throw new ShellError("Error! a student with matnr. " + commandSplit[2] + " already exists");
  10. } else {
  11. prakto.addStudent(commandSplit[1], Integer.parseInt(commandSplit[2]), currentTutor);
  12. }
  13. } catch (ShellError e) {
  14. System.out.println(e.getMessage());
  15. }
  16.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:2: class, interface, or enum expected
					if(currentTutor == null) {
					^
Main.java:4: class, interface, or enum expected
					} else if(commandSplit[1].matches("\\d+")) {
					^
Main.java:6: class, interface, or enum expected
					} else if(!commandSplit[2].matches("\\d+")) {
					^
Main.java:8: class, interface, or enum expected
					} else if(prakto.findStudent(Integer.parseInt(commandSplit[2])) != null) {
					^
Main.java:10: class, interface, or enum expected
					} else {
					^
Main.java:12: class, interface, or enum expected
					}
					^
Main.java:15: class, interface, or enum expected
				} 
				^
7 errors
stdout
Standard output is empty