
- Java Tutorial
- Java - Home
- Java - Overview
- Java - Environment Setup
- Java - Basic Syntax
- Java - Object & Classes
- Java - Constructors
- Java - Basic Datatypes
- Java - Variable Types
- Java - Modifier Types
- Java - Basic Operators
- Java - Loop Control
- Java - Decision Making
- Java - Numbers
- Java - Characters
- Java - Strings
- Java - Arrays
- Java - Date & Time
- Java - Regular Expressions
- Java - Methods
- Java - Files and I/O
- Java - Exceptions
- Java - Inner classes
- Java Object Oriented
- Java - Inheritance
- Java - Overriding
- Java - Polymorphism
- Java - Abstraction
- Java - Encapsulation
- Java - Interfaces
- Java - Packages
- Java Advanced
- Java - Data Structures
- Java - Collections
- Java - Generics
- Java - Serialization
- Java - Networking
- Java - Sending Email
- Java - Multithreading
- Java - Applet Basics
- Java - Documentation
- Java Useful Resources
- Java - Questions and Answers
- Java - Quick Guide
- Java - Useful Resources
- Java - Discussion
- Java - Examples
Convert a String to a List of Characters in Java
Let’s say the following is our string −
String str = "Website!";
Now, convert the above string to a list of characters −
List<Character>list = str.chars().mapToObj(n -> (char)n).collect(Collectors.toList());
Example
Following is the program to convert a string to a list of characters in Java −
import java.util.*; import java.util.stream.Collectors; public class Demo { public static void main(String[] args){ String str = "Website!"; System.out.println("String = "+str); List<Character>list = str.chars().mapToObj(n -> (char)n).collect(Collectors.toList()); System.out.println("List of Characters = "+list); } }
Output
String = Website! List of Characters = [W, e, b, s, i, t, e, !]
- Related Articles
- Convert List of Characters to String in Java
- Java program to convert a list of characters into a string
- How to convert a list of characters into a string in C#?
- C# program to convert a list of characters into a string
- Convert a List of String to a comma separated String in Java
- How can we convert a list of characters into a string in Python?
- Java Program to Convert a List of String to Comma Separated String
- Convert list of strings and characters to list of characters in Python
- Convert characters of a string to opposite case in C++
- Program to convert List of Integer to List of String in Java
- Program to convert List of String to List of Integer in Java
- How to remove a list of characters in string in Python?
- Swapping Characters of a String in Java
- How to convert an array of characters into a string in C#?
- Convert a string representation of list into list in Python

Advertisements