This is my first Java bubbling example, divided into two: pure digital bubber and string Digital bubbling method public class string_maopao {public static void main (string [] args) {// test how Will Int-> String // Int I2s_ORIGIN = 128; // String I2S = String.Valueof (I2S_ORIGIN); //system.out.println (i2s); // Test how to put string-> int // String my_buf = new String ("27"); // int n = integer.parseint (my_buf); //system.out.println (N); // How to test char -> string // char [] cc = {'a' , 'b', '2', '$', 'c', ','}; // String C2S = String.Valueof (cc); //system.out.print (c2s.indexof (',') ); //1. Pure digital bubbling method int [] a = {2, 7, 4, 88, 71, 2005};
MaoPao (a, a.length);
//2. Digital bubbling method in string INT I, J, T = 0; string test = new string ("34, 123, -22, 64, 26"); //system.out.println (Test.Length ()); The length of TEST is 16 //system.out.println (Test.Charat (15)); TEST No. 15 characters are 6, no number 16 characters // Test Substring (int, int, int)) Parameters: The first Start bit, the second is the end bit (excluding the bit)! //System.out.println (Test.Substring (14, 16)); // Doubt: This method is not flexible, can you customize a kind of constructor? INT NUM = getcomparenumber (test); // Num is a number of numbers required in the string [] isub = new string [num]; j = 0; int N_Start = 0; for (i = 0; i < Test.Length (); i ) {if (i == test.length () - 1) {isub [j] = test.substring (n_start, i 1); system.out.println ("String number To: " Integer.Parseint (isub [j])); J ;} else {i (Test.Charat (i) == ',') {isub [j] = test.substring (n_start, i); system .out.println ("The number of strings is:" integer.parseint (isub [j])); n_start = i 1; j ;} // if} // else} T = 0; int m = j ; // Doubt: This method is not flexible, can you customize a kind of constructor? Num = getcomparenumber (TEST); int [] _isub = new int [num]; for (i = 0; i For (_j = 0; _j ) for (_i = 0; _i Class myarray { INT _N; int [] My_Array; public int [] myarray (int [= 0; _n <_Array.length; _n ) my_Array [_n] = _Array [_n]; return my_Array;} public int INT Length () {return my_array.length;} } // Class MyArray