forked from blopker/codebook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.java
More file actions
48 lines (39 loc) · 1.28 KB
/
example.java
File metadata and controls
48 lines (39 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
public class example {
// single line comment with a spelling mistake: helllo
/**
* Block comment with a spelling mistake: byee
*/
// variable declarators with spelling mistakes
short myFavoritNum = 404;
String myFavoiteString = "Hello, World!";
// a string with a spelling mistake
String myStr = "foooooooooooooooood";
// enum declaration with a spelling mistake
enum Levvel {
// enum constant with a spelling mistake
BEGINER,
INTERMEDIETE,
XPERT,
}
// interface declaration with a spelling mistake
public interface Innerexample {
// method declaration with a spelling mistake
void doSmething();
}
// class declaration with a spelling mistake
class PointlessClasss {}
public static void main(String[] args) {
// catch formal parameter spelling mistake
try {
int result = 10 / 0;
System.out.println(result);
} catch (ArithmeticException uhoooh) {
System.out.println(uhoooh);
}
}
// method declaration and formal parameter with spelling mistakes
public String anthrMethod(String smth) {
// string literal with a spelling mistake
return "anthr method called with: " + smth;
}
}