Content deleted Content added
→Syntax: Java syntax is sufficiently readable in English |
|||
Line 54:
In its whole, exception handling code might look like this (in [[Java (programming language)|Java]]-like [[pseudocode]]):
<syntaxhighlight lang="
try {
String line = stdin.nextLine();
if (line.length() == 0) {
Line 62 ⟶ 63:
}
} catch (EmptyLineException e) {
} catch (Exception e) {▼
System.out.printf("Error: %s\n", e.getMessage());
▲catch (Exception e) {
} finally {▼
▲ console.printLine("The program ran successfully.");
▲finally {
console.printLine("The program is now terminating.");
}
|