-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjava.snippets
62 lines (53 loc) · 1.23 KB
/
java.snippets
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
snippet clv "class for Vizury" b
/*
* Copyright (c) `date +%Y` Vizury Interactive Solutions Pvt. Ltd.
*/
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Description of the class ending with a period.
*
* @author Rahul Amaram <[email protected]>
*/
public class ${1:`!p snip.rv = snip.basename or "Unknown"`} {
private static final Logger logger = LoggerFactory.getLogger(
$1.class);
public $1() {
}
/**
* Main method.
*
* @param args command line arguments
*/
public static void main(String[] args) {
}
}
endsnippet
snippet clm "class with main method" b
public class ${1:`!p snip.rv = snip.basename or "Unknown"`} {
public static void main(String[] args) {
}
}
endsnippet
snippet fori "for loop with variable i" b
for (int i = 0; i < n$0; i++) {
}
endsnippet
snippet forj "for loop with variable j" b
for (int j = 0; j < n$0; j++) {
}
endsnippet
snippet fork "for loop with variable k" b
for (int k = 0; k < n$0; k++) {
}
endsnippet
snippet parr "array print loop" b
for (int i = 0; i < arr.length; i++) {
System.out.print(arr[i]);
if (i == arr.length-1) {
System.out.print("\n");
} else {
System.out.print(", ");
}
}
endsnippet