This post shows how to get your current timezone in Java using ZonedDateTime class. Get Current Timezone Using ZonedDateTime Since Java 8, it is possible to determine your current timezone using ZoneDateTime. Suppose you are in Singapore or thereabout; the
Java – Override method to not throw Exception
Modify the method signature of the overriden method to make calling codes not to handle or declare the exception coming from that method.
Maven – Build Web Service client from WSDL file
Using wsimport on the command prompt allows you to generate a client jar, .java, and or .class files depending on the options you pass to it. To use it in Maven, you need to following stuff in your pom.xml
How To Use Java 8 Stream Reduce Example
This post shows how to use Java Stream Reduce with example codes. The idea of the reduce operation is the generation of a single result from a collection of values or objects. It is similar to the min and max operations
Java 8 Get the Min and Max values in a Stream
Do you remember your first programming assignment in college? Most like it is one of those simple Mathematics like get the min and max values from a given list. How about from a list of objects?
Java 8 Convert values in a Stream using Map
Convert any value or object to a different type. For instance, MyEntityBean to MyEntityAPI. No loops. Just Lambda.
Converting Between array and List in Java
Converting Between array and List in Java.
Group List items into Several Lists using Stream in Java 8
Group List items into Several Lists using Stream in Java 8 is easy. We have a list of Persons and we want to group them into Female, Male, Unknown list using Stream and Collectors in Java 8. PersonBean Below is
Create Your Own Functional Interface in Java 8
What is a Functional Interface? [wp_ad_camp_1] Java 8 offers Lambda expressions to help us write better, and concise codes. Lambda expressions revolve around Functional Interfaces. So, what are Functional Interfaces? The simplest definition is: Functional Interfaces are Java Interfaces with
Java Numeric Promotion Rules
Java Primitive Types Consider the following Java primitive types and take note of the type’s size, e.g., 8-bit. For this post, we can ignore boolean, and char as they are not numeric types. [wp_ad_camp_1] Given the following table of Java