Java Guava | Chars.asList() method with Examples Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The Chars.asList() method of Guava's Chars Class accepts a char array as a parameter and returns a list which has the fixed size. The returned list is backed by the char array which is passed as the argument. It means the changes made in the array passed as parameter will be reflected back in the list returned by the method and vice-versa. Syntax: public static List<Character> asList(char... backingArray) Parameter: The method accepts a mandatory parameter backingArray which is a char array that is used to back the list. Return Value: The method Chars.asList() returns a fixed-size list which is backed by the array passed as the argument to the method. In other words, the method returns the list view of the array. Below examples illustrate the implementation of above method: Example 1: Java // Java code to show implementation of // Guava's Chars.asList() method import com.google.common.primitives.Chars; import java.util.List; class GFG { // Driver's code public static void main(String[] args) { // Creating a Char array char arr[] = { 'a', 'b', 'c' }; // Using Chars.asList() method to wrap // the specified primitive Char array // as a List of the Char type List<Character> myList = Chars.asList(arr); // Displaying the elements in List System.out.println(myList); } } Output: [a, b, c] Example 2: Java // Java code to show implementation of // Guava's Chars.asList() method import com.google.common.primitives.Chars; import java.util.List; class GFG { // Driver's code public static void main(String[] args) { // Creating a Char array char arr[] = { 'H', 'E', 'L', 'L', 'O' }; // Using Chars.asList() method to wrap // the specified primitive Char array // as a List of the Char type List<Character> myList = Chars.asList(arr); // Displaying the elements in List System.out.println(myList); } } Output: [H, E, L, L, O] Reference: https://guava.dev/releases/18.0/api/docs/com/google/common/primitives/Chars.html#asList(char...) Comment More infoAdvertise with us Next Article Java Guava | Bytes.asList() method with Examples S Sahil_Bansall Follow Improve Article Tags : Java java-guava Guava-Functions Guava-Chars Practice Tags : Java Similar Reads Java Guava | Bytes.asList() method with Examples The Bytes.asList() method of Guava's Bytes Class accepts a byte array as a parameter and returns a list which has the fixed size. The returned list is backed by the byte array which is passed as the argument. It means the changes made in the array passed as parameter will be reflected back in the li 2 min read Java Guava | Bytes.asList() method with Examples The Bytes.asList() method of Guava's Bytes Class accepts a byte array as a parameter and returns a list which has the fixed size. The returned list is backed by the byte array which is passed as the argument. It means the changes made in the array passed as parameter will be reflected back in the li 2 min read Java Guava | Shorts.asList() method with Examples The Shorts.asList() method of Guava's Shorts Class accepts a short array as a parameter and returns a list which has the fixed size. The returned list is backed by the short array which is passed as the argument. It means the changes made in the array passed as parameter will be reflected back in th 2 min read Java Guava | Shorts.asList() method with Examples The Shorts.asList() method of Guava's Shorts Class accepts a short array as a parameter and returns a list which has the fixed size. The returned list is backed by the short array which is passed as the argument. It means the changes made in the array passed as parameter will be reflected back in th 2 min read Java Guava | Chars.hashCode() method with Examples Chars.hashCode() is a method of Chars Class in Guava Library which is used to return a hash code for a char value. The hashCode is an unique integer value that is calculated by the compiler for an object. It remain the same if the object value does not changes. Syntax: public static int hashCode(cha 2 min read Java Guava | Chars.hashCode() method with Examples Chars.hashCode() is a method of Chars Class in Guava Library which is used to return a hash code for a char value. The hashCode is an unique integer value that is calculated by the compiler for an object. It remain the same if the object value does not changes. Syntax: public static int hashCode(cha 2 min read Like