Please enable JavaScript.
Coggle requires JavaScript to display documents.
News - Coggle Diagram
News
Lambda
print(animals, a -> a.canSwim());
deferred execution
run later
Predicate boolean test
Consumer
void accept(T t);
Supplier
T get();
Comparator
int compare(T o1, T o2);
Only final variables can be in lambda body
instance and static variable is allowed
forEach(Consumer)
Can use with map
there is a BiConsumer to use with values and keys
String methods
strip()
does the same trim() but support unicode
remove whitespace begin/end of string
stripLeading()
remove whitespaces begin
stripTrailing()
remove whitespaces end
intern()
return string from string pool. Otherwise add value to string pool
var
var list = new ArrayList<String>();
it works
var list = new ArrayList<>();
it works
create type of object list
var testes = "var";
Arrays
compare()
0 equals
-1 desc
1 asc
mismatch()
-1 equals
first index they are difference
ArrayList
Sorting
Collections.sort(numbers);
varargs to create a list
Arrays.asList("");
List.of("")
StringBuilder
== evaluate reference