if((Character.isLowerCase(theMessage.charAt(i)))&&j>'z')// if the i'th character of theMessage is lowercase and the value stored in j is greater than the lowercase value of z
{
{
j=(char)(theMessage.charAt(i)-(theOffset-26));
j=(char)(theMessage.charAt(i)-(theOffset-26));// makes j equal to the value of i'th character of themessage minus the value of theoffset minus 26
if(Character.isUpperCase(theMessage.charAt(i))&&j>'Z')// if the i'th character of theMessage is uppercasecase and the value stored in j is greater than the uppercase value of z
{
{
j=(char)(theMessage.charAt(i)-(theOffset-26));
j=(char)(theMessage.charAt(i)-(theOffset-26));//makes j equal to the i'th character of themessage minus the value of theOffset, minus 26
if(Character.isUpperCase(theMessage.charAt(i))&&j<'A')// if the i'th character of theMessage is uppercasecase and the value stored in j is less than the uppercase value of A
{
{
j=(char)(theMessage.charAt(i)+(theOffset+26));
j=(char)(theMessage.charAt(i)+(theOffset+26));// makes j equal to the i'th character of themessage plus the value of the offset plus 26
if((Character.isLowerCase(theMessage.charAt(i))&&j<'a'))// if the i'th character of theMessage is lowercase and the value stored in j is less than the lowercase value of a
{
{
j=(char)(theMessage.charAt(i)+(theOffset+26));
j=(char)(theMessage.charAt(i)+(theOffset+26));// makes j equal to the i'th character of themessage plus the value of the offset plus 26
}
}
string.append(j);
string.append(j);// returns string with the value of j added too it
}
}
returnstring.toString();// returns a string containing whatever is stored in the stringbuilder "string"
returnstring.toString();// returns a string containing whatever is stored in the stringbuilder "string"