Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How does java convert character arrays into int?
How does java convert character arrays into int?
String s = " 485729304

int[]a = new int[s . length()];

for(int I = 0; I & lts.length (). i++)

{

//Convert the String into char, then into string, and then into Integer.

a[I]= integer . parse int(string . value of(s . charat(I)));

}

//The data in the string must be numeric, otherwise an exception will occur;

s . charat(I); Gets the position value of the string I;

string . value of(); Convert a character type to a string;

integer . parse int(); Convert from a string to an integer.

I. Basic concepts

Java is an object-oriented programming language, which can write cross-platform application software. Java technology has excellent universality, high efficiency, platform portability and security, and is widely used in PC, data center, game machine, scientific supercomputer, mobile phone and Internet. At the same time, it has the largest professional developer community in the world.

Two. Main components

Java consists of four aspects:

1.Java programming language, namely grammar.

2.Java file format, that is, suffixes of various folders and files.

3.Java Virtual Machine (JVM) is the interpreter for processing *. Class file.

4.Java application programming interface (Java API).