I write about Java, Spring Boot.
Subscribe to my newsletter and never miss my upcoming articles
In Java, you will see methods like valueOf and parseInt or parseBoolean.
Boolean var = Boolean.valueOf("true");
Boolean var = Boolean.parseBoolean("true");
Why we have these kind of duplicate methods?
There is a difference in these methods.
Java 8 introduced us with Streams. Streams represents a sequence of objects from a source.
Streams provide number of APIs for aggregate operation. Streams take arrays, collections or i/o sources for input.
Two types of Stream operations:
If you are using strings in java , especially in a loop, don't use + operator to connect strings.
String result = "";
for(String s: strArray)
result = result + s;
The above is bad from a performance perspective. Every time, a...