Math类
import java.lang.Math.*;
Math.sqrt();//计算平方根
Math.cbrt();//计算立方根
Math.pow(a,b);//计算a的b次方
Math.max(,);//计算最大值
Math.min(,);//计算最小值
Math.abs();//取绝对值
Math.ceil();//天花板的意思,就是逢余进一
Math.floor();//地板的意思,就是逢余舍一
Math.rint();//四舍五入,返回double值。注意.5的时候会取偶数
Math.round();//四舍五入,float时返回int值,double时返回long值
Math.random();//取得一个[0,1)范围内的随机数
Math.floorMod();//取模
Math.sin();
Math.cos();
Math.tan();
Math.atan();
Math.atan2();
Math.exp();//指数函数
Math.log();//对数
Math.log10();//以十为底的对数
Math.PI;//π
Math.E;//常量e
import static java.lang.Math.*;//不用添加前缀
String类
java.lang.String;
String 变量名=字符串;
String 变量名=new String(字符串);
String(); //创建一个内容为空的字符串//
String(String value); //根据制定的字符串内容创建对象//
String (char[] value); //根据指定的字符数组创建对象//
char charAt(int index);//返回字符串index位置上的字符,其中index的取值范围是:0~(字符串长度-1)
int codePointAt(int index);//返回从给定位置开始的码点
boolean endsWith(String suffix);//判断此字符串是否以指定字符串结尾
int length();//返回此字符串的长度(代码单元个数)
boolean equals(Object anObject);//将此字符串与指定的字符串比较
boolean isEmpty();//当且仅当字符串长度为0是返回true
boolean startsWith(String prefix);//判断此字符串是否以指定的字符串开始
boolean contains(CharSequence cs);//判断此字符串是否包含指定的字符序列
String toLowerCase();//使用默认语言环境的规则将String中的所有字符都转换为小写
String toUpperCase();//使用默认语言环境的规则将String中的所有字符都转换为大写
static String valueOf(int i);//返回int参数的字符串表现形式
char[] toCharArray();//将此字符串转换为一个字符数组
String replace(CharSequence oldstr,CharSequence newstr);//返回一个新的字符串,它是通过用newstr替换此字符串中出现的所有oldstr得到的
String[] split(String regex);//根据参数regex(regex是一个正则表达式,用来限定分隔规则)将字符串分割成为若干个子字符串
String substring(int beginIndex);//返回一个新字符串,它包含从指定的beginIndex起始角标处开始,直到此字符串末尾的所有字符
String substring(int beginIndex,int endIndex);//返回一个新字符串,它包含从指定的beginIndex其实角标处开始,直到索引endIndex-1角标处的所有字符
int offsetByCodePoints(int startIndex,int cpCount);//返回从startIndex码点开始,cpCount个码点后的码点索引
int compareTo(String other);//按照字典顺序,如果字符串位于other之前,返回一个负数;如果字符串位于other之后,返回一个正数;如果两个字符串相等,返回0.(ascll码差值)
IntStream codePoints();//将这个字符串的码点作为一个流返回。调用toArray将他们放在一个数组中
new String(int[] codePoints, int offset,int count);//用数组中从offset开始的count个码点构造一个字符串
boolean empty();//如果字符串为空,返回true
boolean blank();//如果字符串为空格组成,返回true
boolean equalsIgnoreCase(String other);//如果字符串与other相等(忽略大小写),返回true
boolean startsWith(String perfix);//如果字符串以prefix开头,返回true
boolean endsWith(String suffix);//如果字符串以suffix结尾,返回true
int indexOf(String str);
int indexOf(String str,int fromIndex);
int indexOf(int cp);
int indexOf(int cp,int fromIndex);
//返回与字符串str或码点cp匹配的第一个子串的开始位置。从索引0或者fromIndex开始匹配。如果在原始字符串中不存在str,则返回-1.
int lastindexOf(String str);
int lastindexOf(String str,int fromIndex);
int lastindexOf(int cp);
int lastindexOf(int cp,int fromIndex);
//返回与字符串str或码点cp匹配的最后一个子串的开始位置。从原始字符串末尾或者fromIndex开始匹配。
int codePointCount(int startIndex,int endIndex);//返回startIndex和endIndex-1之间的码点个数
String replace(CharSequence oldString,CharSequence newString);//返回一个新字符串。这个字符串用newString代替原始字符串中所有的oldString。可以用String或SytringBuilder对象作为CharSequence参数
String trim();
String strip();
//返回一个新的字符串。这个字符串将删除原始字符串头部和尾部小于等于U+0020的字符(trim)或空格(strip)
String join(CharSequence delimiter,CharSequence... elements);//返回一个新字符串,用给定的定界符连接所有元素。
String repeat(int count);//返回一个字符串,将当前字符串重复count次。
Random类
import java.util.Random;
Random();//构造一个新的随机数生成器
int nextInt(int n);//返回一个0~n-1之间的随机数