Squares 2 /* Squares2 使用 method square */ public class Squares2 { public static void main( String[] args ) { for (int index = 1; index <= 10; index ++) { System.out.println( The square of + index + is + ( square( index ))); System.out.println( The sum of + index + +2 squared is + ( square( index+ 2))); System.out.println( The sum of + index + squared+ 2 is + (( square( index))+2) ); System.out.println(); } System.exit(0); } // end of main
{}