阅读背景:

为什么我在线程主错误中遇到异常?

来源:互联网 
import java.util.Scanner;

public class ReverseOrder
{

    char input;

   public static void main (String[] args)
   {


       Scanner reader = new Scanner (System.in);

       char [] ch = new char[5];


      System.out.println ("The size of the array: " + ch.length);

      for (char index = 0; index < ch.length; index++)
      {
         System.out.print ("Enter a char " + (index+1) + ": ");
         ch[index] = reader.next().charAt(0);
      }

      System.out.println ("The numbers in reverse order:");

      for (char index = (char) (ch.length-1); index >= 0; index--)
         System.out.print (ch[index] + "  ");
       }

}
import java.util.Scanner;

public class Reverse



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: