-
Is Java pass-by-value or pass-by-reference?
In Java, for primitive types, parameters are pass-by-value; For object types, object reference is pass-by-value, however, Java is allowed to modify object’s fields via object reference.
Date: 2019-08-11 View: 1520
-
Java List java.lang.UnsupportedOperationException
A simple List.add() and hits the following java.lang.UnsupportedOperationException
Date: 2019-08-11 View: 1520
-
Java two-dimensional array example
A Java 2d array example.
Date: 2019-08-11 View: 1520
-
How to get user input in Java
In Java, we can use java.util.Scanner to get user input from console.
Date: 2019-08-11 View: 1520
-
java.lang.UnsupportedClassVersionError
Start a Java class and hits this java.lang.UnsupportedClassVersionError, what is class file version 52 56?
Date: 2019-08-11 View: 1520
-
How to check which JDK version compiled the class?
In Java, we can use javap -verbose className to print out the class information.
Date: 2019-08-11 View: 1520
-
Java Convert ArrayList<String> to String[]
In the old days, we can use list.toArray(new String[0]) to convert a ArrayList<String> into a String[]
Date: 2019-08-11 View: 1520
-
Jackson How to parse JSON
Jackson provide writeValue() and readValue() methods to convert Java objects to / from JSON.
Date: 2019-08-11 View: 1520
-
Java Check if a String is empty or null
In Java, we can use (str != null && !str.isEmpty()) to make sure the String is not empty or null.
Date: 2019-08-11 View: 1520
-
Java How to check if a String is numeric
Few Java examples to show you how to check if a String is numeric.
Date: 2019-08-11 View: 1520
-
JSON.simple – How to parse JSON
In this tutorial, we will show you how to parse JSON with JSON.simple
Date: 2019-08-11 View: 1520
-
Java Convert Array to ArrayList
In Java, we can use new ArrayList<>(Arrays.asList(array)) to convert an Array into an ArrayList
Date: 2019-08-11 View: 1520
-
Java – Convert String to double
In Java, we can use Double.parseDouble() to convert a String to double
Date: 2019-08-11 View: 1520
-
Java How to generate a random String
Few Java examples to show you how to generate a random alphanumeric String, with a fixed length.
Date: 2019-08-11 View: 1520
-
Java password generator example
A Java example to generate a strong, secure random password containing [a-zA-Z0-9!@#$%&*()_+-=[]?] characters, with a length of 15.
Date: 2019-08-11 View: 1520