/********************************************* 配列05 文字列を逆並びで表示する *********************************************/ import java.util.*; public class Array05Reverse { public static void main(String[] args) { Scanner sc=new Scanner(System.in); char[] before; // 変換前の文字配列 char[] after; // 変換後の文字配列 String keybd; // 文字列変数 int charCount; // 文字数(配列の要素数) System.out.print("文字列を入力してください-->"); keybd=sc.nextLine(); before=keybd.toCharArray(); // 配列beforeに文字を格納 charCount=before.length; // 要素数を求める System.out.print("\n文字数="+charCount); after=new char[charCount]; // 配列afterの生成 int m; m=charCount-1; for ( int n=0 ; n"); System.out.print(keybd); } }