Java 7 provides a new approach for closing resources with clean & clear code by try-with-resources statment. In the article, JavaSampleApproach will introduce the benifit when programming by try-with-resources statement.
JavaSampleApproach will guide you how to read a text file by many approaches: BufferedReader, Java7 and Java8 with Java Read Text File
Java Thread Pool is a performance solution for scaling system, so JavaSampleApproach will guide you how to work with Java Thread Pool by ExecutorService and Executors.
Java 8 Base64 provides a standard way to do Base64 encoding and decoding.
There are three types of Base64 encoding:
– Basic: Encoder produces a set of characters within A-Za-z0-9+/. Decoder rejects any character NOT mapped to A-Za-z0-9+/.
– URL: Encoder produces a URL or safe filename which is set of characters within A-Za-z0-9+_.
– MIME: Output is mapped to MIME friendly format.
Null reference causes many problems because it often denotes the absence of a value. Java 8 Optional is a new class that can help us handle these cases instead of checking null.
This article introduces Java 8 Date Time API with many example lines of code. So by reading each line, we can understand how to work with this feature.
In previous posts, we have concept of how to use CompletableFutures. This tutorial is about combining multiple CompletableFutures, it is one of the most important and useful abilities of Java 8 asynchronous processing.
Memory Consistency Errors are common problems with Multi Thread Programming. In the tutorial, JavaSampleApproach will introduce you about Java Synchronized, is one of the solution for resolving problems related with Consistency Errors.
Exception handling is important in software development, Java 8 CompletableFuture also provides methods to handle errors when they occurs.
Java 8 multithreading programming has an important feature named CompletableFuture.
In previous post about Java Future, we have the concept of a Future object, which can help us make something done while waiting for other things. However, although we can inspect Future objects to see if they’re done, what if we wanna execute some code whenever its ready? We still have to wait until the result is available.
CompletableFuture meets the requirement, and more than that.
In the article, JavaSampleApproach will introduce you about Queue interface in Java and give you sample for practice.
In multithreaded programming, Java Future with Callable is very important for tasks which we want to know status and get the returned object.
This article give us an example for how to work with Future and Callable inside.
In the tutorial, JavaSampleApproach will provide all most of solution for find the n-th Fibonacci number with Java statements: for, do while, while and recursion implementation.
The tutorial will guide you how to use Jackson for converting Java object to Json and vice-versa.
– Gson for converting Java Object to/from Json
– How to convert Java Object into/from XML – with Castor & Spring Boot
– How to use @JsonView to serialize/de-serialize and customize JSON format from Java Object.
The tutorial guides you how to convert Java Object to Json and vice-versa by Gson.
This tutorial will help you have a deep view of Java 8 Streams: what they are, ways to create them, how they work with intermediate operations, terminal operation…
Method References make it clear when referring to the existing method by name.
When using lambda expression without input arguments or those input arguments doesn’t make sense, we can use Method References to simplify the syntax.
This tutorial introduces four kinds of Method References and how to use them efficiently with some Functional Interfaces.
Functional Interfaces is one of the new important things of Java 8. In previous article, we had a little view about common use cases of Lambda Expression including Runnable and ActionListener. They are example of Functional Interfaces.
This tutorial helps you have deeper concept of Functional Interface, then some interfaces which are provided in java.util.function package such as Predicate and Function.
Lambda expressions are new feature in Java 8. We now can represent one method interface by using an expression.
Java is an Object Oriented Programming Language. Object and Class are 2 main concepts of Java.
What are Java Object & Java Class?
The tutorial will introduce Java Object & Java Class.
How to initialize the state of Java object?
The tutorial will introduce Java Constructor for resolving above question.