Tags: alotfor, charat, code, explain, ilts2, int, java, jgtlt80, lines, means, pls, thanx

What does the 'charAT' means?

On Java Studio » Java Knowledge

1,042 words with 5 Comments; publish: Sat, 22 Sep 2007 17:19:00 GMT; (15078.13, « »)

Can someone pls explain the this few lines of code. thanx alot

for (int i=0; i<s2.length(); i++){

for (int j=0; j><=80; j++) {

if( s2.charAt(i)==s1[j] )

System.out.print( s1[(j+num1)%80] );//num1 is the input from user

else if ( s2.charAt(i)!=s1[j] )

donothing++;

All Comments

Leave a comment...

  • 5 Comments
    • charAt mean use string object like char array. for example String str="abcde";str.charAt(0) means a;str.charAt(3) means d;
      #1; Fri, 06 Jul 2007 13:42:00 GMT
    • And what does the charAt means in that few lines of code posted by me?
      #2; Fri, 06 Jul 2007 13:42:00 GMT
    • ok and do u understand the 1st three lines as well.im kinda confused with the for loopThanx
      #3; Fri, 06 Jul 2007 13:42:00 GMT
    • first line means the loop will do until end of the string (s2) increment by 1
      #4; Fri, 06 Jul 2007 13:42:00 GMT
    • > And what does the charAt means in that few lines of

      > code posted by me?

      As has already been posted it means 'get the character at position i'.

      Is it that you are expecting someone to tell you what ALL the code does? If so then without the context I would only be guessing!

      #5; Fri, 06 Jul 2007 13:42:00 GMT