Recently I’ve rediscovered Class.cast(object) that can be used to cast objects to a type. In Java 8 streams the method allows to do a nice Java casting trick.
Continue reading Java casting trickjava-basics
How to generate in Java 8 range of numbers? This is practical problem, often met when writing tests. In this post we’ll cover fast implementation, comfortable, and flexible with Java 8 Streams!
Continue reading Java 8 range of numbersIn Java int to String conversion can be done in a different ways and converted String can be in different formats. In this post we’ll show on examples how to convert them.
Continue reading Java int to StringIn Java String to int conversion can be done in a few different ways. In this post we’ll show them and describe differences.
Continue reading Java String to intJava Reverse String in 2 ways Java String doesn’t have reverse method, so it may not be immediately apparent how to reverse a string in Java. Here are two ways do do it.
Continue reading Java Reverse String in 2 waysJava unchecked warnings In this tutorial we’re going to show how to eliminate unchecked warnings that occur frequently when mixing Java Generics with legacy code.
Continue reading Java unchecked warningsJava Split String In this tutorial we’re going to show how to split string effectively in Java, consider alternative ways and what are differences between them.
Continue reading Java Split String in various waysJava Initialization order In this tutorial we’re going to show what is initialization order of fields (instance and static) in Java when JVM loads a class.
Continue reading Java Initialization orderProblem: How to load Properties in Java? Properties class has methods to load properties from different sources – InputStream, Reader, and XML file. Here’s an example of Properties.loadFromXML(InputStream).
Continue reading Java Properties load from XMLProblem: How to load Properties in Java? Properties class has methods to load properties from different sources – InputStream, Reader, and XML file. Here’s an example of Properties.load(InputStream).
Continue reading Java Properties load