Java Program to Convert char to String with Explanation

Published: 20 January 2021
on channel: Talented Developer
7,577
67

#javatutorialforbeginners #javaprogramming
Java Program to Convert char to String with Explanation

All Java Programs | Java Coding Interview Questions:
   • All Java Programs | Java Coding Interview ...  

Code Repository: https://github.com/talenteddeveloper/...

There are two ways you can do char to String conversion –
1. Using Character.toString(char ch) method
2. Using String.valueOf(char ch) method

1. Java char to String conversion using Character.toString(char ch)
We can also use the toString(char ch) method of Character class to convert the passed char ch to a String. Similar to String.valueOf(char ch) method, this method also accepts char as a parameter and returns an equivalent String.

2. Java char to String example using String.valueOf(char ch)
We can use the valueOf(char ch) method of String class to convert a passed char ch to a String. This method accepts char as an argument and returns the string equivalent of the argument

Follow on Facebook:   / talenteddeveloper  

Same query:

convert char to String in java,
char to string java


On this page of the site you can watch the video online Java Program to Convert char to String with Explanation with a duration of hours minute second in good quality, which was uploaded by the user Talented Developer 20 January 2021, share the link with friends and acquaintances, this video has already been watched 7,577 times on youtube and it was liked by 67 viewers. Enjoy your viewing!