Java Program to Convert char to String with Explanation

Publicado em: 20 Janeiro 2021
no canal de: 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


Nesta página do site você pode assistir ao vídeo on-line Java Program to Convert char to String with Explanation duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Talented Developer 20 Janeiro 2021, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 7,577 vezes e gostou 67 espectadores. Boa visualização!