YMYogesh Maliinsimplejavatips.com·Sep 3, 2020 · 1 min readDifference between valueOf and parse methodsIn 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. Bool...00
YMYogesh Maliinsimplejavatips.com·Aug 25, 2020 · 1 min readHow to use Streams APIJava 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: Intermedi...00
YMYogesh Maliinsimplejavatips.com·Aug 15, 2020 · 1 min readAvoid String ConcatenationIf 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; } return result; The above is bad from a performance perspective. Every time, a...00