There are four interfaces that can represent a stream of data: Stream, IntStream, LongStream, or DoubleStream – all in the package java.util.stream since Java 8
Articles related to : Java programming
Java streams 1. Intro
Java 8 stream is pull-based and can be used any time one uses Java 8+. It allows iterate of the values provided by the Stream object, which can represent a collection, file, or any other source of data.
Lambda expressions 1. Basics
Lambda expression allows simplifying an interface implementation, but only in the case of an interface with one abstract method only (called a functional interface). Instead of creating a class that implements the interface (and pass its object as a parameter), a lambda expression allows to to pass in only the method body, without creating an […]
Reactive programming 1. Basic idea
Reactive programming is considered difficult to learn, but it should not be. You have just grasp the very basic idea, and after you do, reactive programming becomes a more natural way to build data processing chain than the traditional procedural way.
Java functional programming
Functional programming sounds daunting for those, who are not familiar with it. But in fact, it is a very easy and elegant concept that allows writing much less and more compact code that contains only the essential functionality – without any plumbing.
Exception handling. Use RunitmeException only.
Exception handling in Java may be a source of much confusion and unnecessary code writing. But it should not be this way. Contain checked exceptions as soon as possible and use unchecked exceptions only. It is easy.
OOD is easy. Just follow OOP.
Number of books written about Object-Oriented Design (OOD) is huge and growing. Same may be said about Object-Oriented Principles (OOP). But there is an innate relationship between the two. If you know it, both look much simpler.
Hiding vs overriding
Difference in the accessibility to the child public fields and methods using the reference to the parent can be a source of a confusion which we are going to resolve in this post.
String object is immutable. What does it mean?
In Java, String objects are immutable. Yet, it seems we are able to change them all the time. This contradiction is the source of much confusion. This article clarifies the matter and helps to avoid the confusion.
Method equals() is the correct way to compare String objects
Method equals() compares objects by reference and by value. In the case of literals, comparison by reference is enough. Which means that method equals() as fast while comparing literals as the reference comparison.