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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

find char array size?

A

int len=ch.length;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

find String length?

A

int len=str.length();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Copy String to char[] ?

A

String str=”hello”;
int len=str.length();
char[] str1=new char[len];

for(int i=0;i
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Copy String to String ?

A

String str=”hello”;

String str2=str;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly