package com.test;public class ceshiDemo { public static void main(String[] args) { int[] g = { 2, 6, 7, 9, 1 }; int x; for (int b = 0; b < g.length ; b++) { for (int c = 1; c < g.length-1-b; c++) { if (g[b] > g[c+1]) { x = g[b]; g[b] = g[c]; g[c] = x; } } } for (int b = 0; b < g.length; b++) { System.out.println(g[b]); } }}