(主要是自己不会的知识和容易搞错的东西)

计算某个程序运行的时间

long stime=System.currentTimeMillis();
copy3(file, file2);//copy是一个函数
long etime=System.currentTimeMillis();
System.out.println("花费的时间为:"+(etime-stime)+"毫秒");

构造函数没有返回值

例:暂时不知道怎么解释
String str=new String("content");

多线程中, thread.start()后再设置其为守护程序会报错。
如何将全是数字的字符串中的数字提取出来

int num=Integer.valueOf(str);

如何对整数数组进行排序

int[] nums=new int[10];
Arrays.sort(nums);//它会自动将数组排好顺序,并存储到原数组中

正则表达式的一处运用

String str="123\453\eqrf\eqr";
String[] split=str.split("\");将str以“\”为界分成四部分。
正则表达式怎么分“\”
String[] nameStrings=name.split( "\\\\");

已经写了参数构造方法,系统就不会给默认的构造方法 。

相关文章:

  • 2021-11-19
  • 2021-07-11
  • 2022-01-02
  • 2021-06-10
  • 2021-05-05
  • 2021-05-18
  • 2021-06-24
猜你喜欢
  • 2021-12-05
  • 2022-01-30
  • 2022-02-04
  • 2021-09-29
  • 2021-03-27
  • 2021-12-30
  • 2022-12-23
相关资源
相似解决方案