Why this code giving output zzzzzzzzz if input is sololearn
import java.util.Scanner; public class Program { public static void main(String[] args) { char [] z = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' '}; char [] a = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; Scanner sc = new Scanner(System.in); String n = sc.nextLine(); char c='a'; String w =""; for(int j=0;j<=n.length()-1;++j){ for(int i=0;i<=25;++i){ if(n.charAt(j)==z[i]){ c = z[26-i]; } if(n.charAt(j)==a[i]){ c=a[26-1];} if(n.charAt(j)==' '){ c=' '; } } w=c+w; } System.out.print(w); } }