Sunday, August 21, 2016

String in Java

Strings in Java

1. int n;
char chr;
String st1=”Rakesh Roshan”;
n=st1.indexOf(‘e’);
chr=st1.charAt(5);

what will be the value of n and chr?

2. int n;
String str1=”Rakesh”;
String str2=”Roshan”;
n=str1.compareTo(st2);

what will be the value of n ?

1 comment:

  1. You have a question Where to Find Software Developers? Youteam is a recruiting platform similar to companies like X-Team. Youteam connects you a with qualified team of developers for a variety of tech projects.

    ReplyDelete