1.string[] Args
Args[i].charat (j): Indicates that the expression will extract the first J characters from the I command-line arguments.
2.ArrayList objects
ArrayList are similar to arrays, but ArrayList can be extended to any size. (in the Java.util package)
Create Arraylist:arraylist table=new ArrayList ();
add element: Table.add (...);
3. Calculate the big factorial 20! is the maximum factorial that a 64-bit integer can hold
The Java.math.BigInteger class represents any large integer, BigInteger is an object rather than a base value, and you cannot simply use the * operator to complete the multiplication of BigInteger objects, you should use the multiply () method.
e.g. for (int size=table.size (); size<=x;size++)
{
BigInteger lastfact= (BigInteger) table.get (size-1);
BigInteger nextfact=lastfact.multiply (biginteger.valueof (size));
Table.add (nextfact);
}
4.integer.parseint (): Converts a string that is drawn to a number
The ReadLine () method of the 5.BufferedReader object implements the technique of reading user input from the keyboard
BufferedReader in=new BufferedReader (New InputStreamReader (system.in));
for (;;)
{
System.out.print (">");
String Line=in.readline ();
if ((line==null) | | | Line.equals ("quit")) break;
}
The string class representing strings in 6.java is immutable. That is, no method is provided to allow the content of the string to be modified. The method for string manipulation returns a new string, not a modified copy of the original string. To manipulate a string in place, you use the StringBuffer object.
String Line=in.readline ();
StringBuffer buf=new StringBuffer (line);
for (int i=0;i<buf.length;i++)
Buf.setcharat (I,buf.charat (i)-1);
Java Step1: Basic knowledge 1