+ 1

Hey guys I am not able to understand the below code someone pls explain it."char arr[]=str.toCharArray;

This code of line is based on java

18th Apr 2022, 1:21 PM
saseentharan p
saseentharan p - avatar
5 Answers
+ 2
it is not a stream, it just copies the bytes[] of the String and up-casts it to char[]
18th Apr 2022, 7:10 PM
zemiak
+ 1
char arr[] = str.toCharArray() ; This line convert String str into a stream of character and stored in a character array arr, as single individual array of characters of str String. Ex: str= "abc"; after that line executed arr[0] = 'a', arr[1]='b', arr[2]='c'; Hope it helps...
18th Apr 2022, 1:29 PM
Jayakrishna 🇼🇳
+ 1
Thank you Jaya Krishna it is helped me lot
18th Apr 2022, 1:50 PM
saseentharan p
saseentharan p - avatar
0
I means sequence of characters actually.. in general sence. Yes, there the difference but i thought concept will not affect. No not bother to to modify..
18th Apr 2022, 7:27 PM
Jayakrishna 🇼🇳
0
Ok thank you guys
19th Apr 2022, 2:31 AM
saseentharan p
saseentharan p - avatar