Type casting / conversion . | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Type casting / conversion .

you all may have heard of type casting and its types which are implicit type coercion and explicit type casting but is it possible for a string to be casted into char data types? how ?

23rd Apr 2017, 12:51 AM
Rishabh
Rishabh - avatar
2 Respostas
+ 3
using the character class --- String a = "apple" ; char c= a.chart(0); āž– // returns 'a' char[]c_arr=a.toCharArray(); āž– // returns the length of 4 char ['a','p','p','l','e'] Bidding a farewell to every reader !šŸ˜€
23rd Apr 2017, 1:19 AM
Rishabh
Rishabh - avatar