Use java to implement an array loop step by step shift operation 1. the background teacher assigned several java programming questions in the class. This is one of them. design a class, add a constructor with a parameter, and encapsulate a method. When this method is called consecutively, the following elements are output in sequence: 5 7 4 8 9 1 2 call output: 1 5 7 4 8 9 3 call output: 9 1 5 7 4 8 4 call output: 8 9 1 5 7 4 5 call output: 4 8 9 1 5 7 6 call output: 7 4 8 9 1 5 3. code (with code explanation) [java] <span style = "font-family: SimSun; font-size: 14px"> package One; /*** @ author Kun Sun * @ Date: 2013.10.15 */public class Move {// mobile class int array []; public Move (int array []) {this. array = array;} private void movebit (int array []) {// shift method int temp; temp = array [array. length-1]; for (int I = array. length-1; I> 0; I --) {array [I] = array [I-1];} array [0] = temp;} public void talk () {// encapsulate movebit (array);} public void print (int array []) {// output int I = 0; for (I = 0; I <array. length; I ++) {System. out. print (array [I] + "");} System. out. println () ;}</span> [java] <span style = "font-family: SimSun; font-size: 14px"> package One; /*** @ author Kun Sun * @ Date: 2013.10.15 */public class MainClass {// used to test the mobile class/*** @ param args */public static void main (String [] args) {// TODO Auto-generated method stub int array [] = new int [] {5, 7, 4, 8, 9, 1}; Move move = new Move (array); int I = 0; while (I <6) {System. out. println ("no." + (I + 1) + "Call output:"); move. print (array); move. talk (); I ++ ;}}</span> 4. test Run result