fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.lang.*;
  4.  
  5.  
  6. /* Name of the class has to be "Main" only if the class is public. */
  7. class Ideone
  8. {
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11.  
  12. int array[]={1,2,3,4,5};
  13. String s1="PPNPN";
  14.  
  15. char []array1=s1.toCharArray();
  16. String out[] = new String[array1.length];
  17. for(int i = 0; i < array1.length; i++)
  18. {
  19. out[i] = array1[i]+" -> "+array[i];
  20. }
  21.  
  22.  
  23. for (String val : out)
  24. {
  25. System.out.println(val);
  26. }
  27. }
  28. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
P -> 1
P -> 2
N -> 3
P -> 4
N -> 5