-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJava_notes.txt
33 lines (20 loc) · 1.6 KB
/
Java_notes.txt
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
https://www.javaworld.com/article/2073352/core-java/simply-singleton.html?page=2
InputStream configJsonStream = ResourceLoader.class.getResourceAsStream("project.config.json");
Files.copy(configJsonStream, projectDir.resolve("project.config.json"));
Files.write( Paths.get(path), content.getBytes(), StandardOpenOption.CREATE);
DirectoryDialog dirDialog = new DirectoryDialog(shell); //FileDialog
Activating annotation based null pointer access analysis
Select Windows ▸ Java ▸ Compiler ▸ Errors/Warnings and select Enable annotation-based null analysis.
///Interface trong Java 8, giới thiệu Default Method và Static Method
///
Functional Interface là cách gọi khác của SAM(Single Abstract Method) interface, tức là những interface chỉ có duy nhất một method, ví dụ như Runnable, Callable, Comparator, ActionListener, FileFilter, PropertyChangeListener ... Từ Java8, một annotation mới @FunctionalInterface cũng đã được giới thiệu để đánh dấu một interface nào đó là Functional Interface. @FunctionalInterface annotation là tiện ích để tránh việc vô tình thêm vào các phương thức trong Functional Interface.
///spread syntax
spread operator ... cho phép chuyển đổi một chuỗi thành nhiều argument (khi gọi hàm), hoặc nhiều phần tử (với array)
const max = (arr) => Math.max(...arr);
const one = ['a', 'b', 'c']
const two = ['d', 'e', 'f']
const three = ['g', 'h', 'i']
const result = [...one, ...two, ...three]
///Object.create(null)
/// Get the string representation of a DOM node
document.documentElement.innerHTML