Arrays.asList in Java Examples

We generally use Arrays.asList method to copy an object array into a List object. It returns a fixed-size List object from the object array that you have passed to this method. Since Arrays.asList method returns a fixed-size List object, you must remember that you cannot add or remove elements from this List object as you … Read more

How to Convert an Array to List in Java?

Though an array is an object in Java, it doesn’t have the required methods to convert it to a List object, it just contains the basic methods that it derived from the Object class. But if you want to convert an array to List, we have other alternatives. Using Arrays.asList(Object[]) Arrays.asList method can take an … Read more

[Solved] error: char cannot be dereferenced

While running a Java program, are you getting “error: char cannot be dereferenced” compilation error in calling methods like equals, isLetter, etc? In this post, we’ll look at the reasons you are getting this error and the solutions to fix it. Why do we get this error? Char cannot be dereferenced – compilation error occurs … Read more