Java primitive data types

Java has eight built-in data types, referred to as the Java primitive types. boolean Type: true or false Example: byte Type: 8-bit integral value Example: short Type: 16-bit integral value…

Java null pointer exception

NullPointerException is a runtime exception and it is thrown when the application tries to use an object reference that has a null value. Let`s look to the Oracle doc one…

Java Array to List

Java Array to List

Converting array to list in Java But then if you do something like this: you get java.lang.UnsupportedOperationException. So for some cases you even need this: Explicit type argument Integer can be…

Java Try With Resources

The Java try with resources construct automatically close resources like a Java InputStream or a JDBC Connection. The resources we declare in the try block should extend the java.lang.AutoCloseable class. It looks like a…

Java write to file

Write With FileWriter Write With BufferedWriter The advantage of using BufferedWriter is that it writes text to a character-output stream, buffering characters so as to provide for the efficient writing (better performance)…

HOW TO CONVERT JAVA INT TO STRING

1. Converting Integer to String in Java using Integer.toString(int) Output 2. Converting Integer to String in Java using String.valueOf(int) Output 3. Converting Integer to String in Java using String.format() Output 4. Converting Integer…

STRING TO JSON IN JAVA

JSON String example: Converting JSON String to Java object: The Gson is an open-source library to deal with JSON in Java Java Object:

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!