calling 2 methods in a stream java code example
Example 1: iterate map in java 8 using stream
public void iterateUsingStreamAPI(Map<String, Integer> map) {
map.entrySet().stream()
// ...
.forEach(e -> System.out.println(e.getKey() + ":" + e.getValue()));
}
Example 2: using class in java
public class HelloWorld {
public static void main(String[] args) {
// how to use class in java
class User{
int score;
}
User dave = new User();
dave.score = 20;
System.out.println(dave.score);
}
}