Strings Flashcards
1
Q
Copy String to char[] ?
A
String str="hello"; int len=str.length(); char[] str1=new char[len]; System.out.println("str = "+str); for(int i=0;i
2
Q
find char array size?
A
int len=ch.length;
3
Q
find String length?
A
int len=str.length();
4
Q
Copy String to char[] ?
A
String str=”hello”;
int len=str.length();
char[] str1=new char[len];
for(int i=0;i
5
Q
Copy char to string ?
A
String str=””;
char ch[]={‘H’,’e’,’l’,’l’,’o’};
int len=ch.length;
for(int i=0;i
6
Q
Copy String to String ?
A
String str=”hello”;
String str2=str;