This is an awesome article. Here is the summary:
Nested class is declaring a class inside another class. There are 2 types:
This code declare a function that can take arbitrary number of parameters. The parameters must be the same type int
.
void sampleFunction(int... args) {
System.out.print(args.length);
for (int i = 0; i < args.length; i++) {
System.out.print(args[i]);
}
}
It’s possible to mix varargs
with other parameter types, like this:
void sampleMixingFunction(String name, Date date, int... args) {
...
}
The varargs
must be the last parameters in function signature.
It’s not allowed to declare multiple varargs
in one function.
Been learning Java for a while and using HashMap many times, but today I read an article about HashMap’s buckets length and think I should dig deeper to understand it. This article is to summarize about HashMap, and how it works internally.
more...