Showing posts with the label Char

How to convert Char to String in Java

In this section, we will show you h ow to convert Char to String in Java. public class Main { public static void main ( String [] args) { String str = "" ; //convert a String into char char charK = str .charAt( 0 ); //k char charL = str .charAt( 4 ); //l char charC = str .charAt( 11 ); //c System . out .println( charK ); System . out .println( charL ); System . out .println( charC ); //convert char back to String String temp = Character . toString ( charK ); System . out .println( temp ); } } Console Output: k l c k How to calculate days between two dates in Java 8? How to read a file in Java with BufferedReader Java 8 Streams - Count Frequency Of Words In a List Java 8 Streams - Program To Break A List Into Batches Of Given Size Remove duplicates from an array in Java Java Program To Convert String To HashMap Java 8 Stream - Remove duplicates from a l