title: Simple Caesar Cipher in Java
body: <p>I'm trying to make a simple Caesar cipher in java that accepts 2 arguments. One being the phrase, and the next being the shift of the letters. </p>
  
  <p>I'm very new to Java, and I'm still trying to understand the basics. As a requirement, the cipher should keep capital letters capital, and lower case letters lower case. The space between words should also be left alone. </p>
  
  <p>So far I have declared the the variable for the shift and have made 2 separate strings for lower case letters and uppercase letters. I'm not too sure where to proceed from here. Any help would be greatly appreciated.</p>
  
  <pre><code>public class caesar2{
  public static void main(String args[]){
      String phrase = args[0];
      //First Argument
      String k = args[1];
      //Second argument
      //The shift of the letters in the caesar Cipher
      char characters[] = phrase.toCharArray();
      //Sending the input characters into a character array 
      int shift = Integer.parseInt(k);
      int remainder = shift % 26;
      //The shift = value K       
      for( int i=0; i &lt; characters.length; i++)
      {
          if ((Character.isUpperCase(characters[i]))== true)
          {
              if((int)(characters[i]) + remainder &gt;= 90)
              {
                  characters[i] = (char)(characters[i]-(26-remainder));                   
              }
              else
              {
                  characters[i] = (char)(characters[i]+remainder);
              }
          }
          else if (Character.isLowerCase(characters[i])==true)
          {
              if ((int)(characters[i] + remainder) &gt;= 122)
              {
                  characters[i] = (char)(characters[i] - (26-remainder));
              }
              else
              {
                  characters[i] = (char)(characters[i]+remainder);
              }
          }   
      }
      for(int i =0; i&lt; characters.length;i++)
          System.out.println (characters[i]);
      {
          }
  }
  </code></pre>
  
  <p>}</p>