- publicstaticvoid test() {
- System.out.println( "Please enter 5 sentences" );
- String string[] = new String[] { "In java," , "arrays can be stored" , "a group of consecutive," , "same data type" , "elements" };
- for (int i = 0; i < string.length; i++) {
- System.out.println("第"+(i+1)+"句话:"+string[i]);
- }
- System.out.println( "\n" + "Output 5 sentences in reverse order: " );
- for (int i = string.length-1; i >=0; i--) {
- System.out.println(string[i]);
- }
- }
Chapter 1
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325767529&siteId=291194637
Recommended
Ranking