Replace with Next Letter

Given a string the task is to change all the letter of that string to the succeeding letter. The letter ‘Z’ or ‘z’ must be changed to ‘A’ or ‘a’ respectively.

Example: Consider a word “Zebra”. The program outputs “Afcsb”.

Java
import java.util.*;
public class NextLetter
{
    public static void main(String args[])
    {   
        int l=0;
        char ch=' ';
        String str="",result="";
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter a word: ");
        str=sc.next(); 
        str=str.trim();      
        l=str.length();
        for(int i=0;i<l;i++)
        {
            ch=str.charAt(i);
            if(ch=='z')
            {
                result=result+'a';
            }
            else if(ch=='Z')
            {
              result=result+'A';  
            }
            else
            {
               result=result+(char)(ch+1);
            } 
        }
        System.out.println("New word: "+result);
    }
}
Java