1. To turn a string into an integer, generally in the algorithm involves the calculation of large numbers need to use
Class test{public static void Main (string[] args) { strings= "233123"; int i=integer.parseint (s); Error System.out.println (i) when there are non-numbers in S
2. For the processing of negative numbers, first determine whether it is negative, and then remove the minus sign to calculate, after the calculation and add
Class test{public static void Main (string[] args) { strings= " -233123"; int i=integer.parseint (s);//float SOURCEF = S.parsefloat (SOURCESTR); becomes floating point//system.out.println ("Hello world!" +i); char frist = S.charat (0); Gets the first character of the string //if (frist== '-') {System.out.println (frist);} Determines whether the first character is a-//system.out.println (frist); String leave = s.substring (1,s.length ()); Intercepts all characters except the first string//system.out.println (leave); String NewS = string.valueof (i); Turns an integer into a string System.out.println (NewS); String add = "-" +s; Stitching string //System.out.println (add);}}
3.java Processing of linked lists
Java Trivia points