Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132930 views
License: OTHER
1
public class Main {
2
3
/**
4
* @param args
5
*/
6
public static void main(String[] args) {
7
Fibonacci f = new Fibonacci();
8
for (int i = 0; i < 10; i++) {
9
System.out.println(f.getFunctionValue(i));
10
}
11
12
/* Fehlerbehandlung */
13
try {
14
f.getFunctionValue(-2);
15
} catch (IllegalArgumentException e) {
16
System.out.println("Your Error: ");
17
System.out.println(e);
18
}
19
}
20
21
}
22
23
24