我有一个类似的字符串
String s="hello.are..you";
String test[]=s.split("\\.");
Run Code Online (Sandbox Code Playgroud)
测试[]包括4个元素:
hello
are
you
Run Code Online (Sandbox Code Playgroud)
如何使用split()生成三个非空元素?
我有一些像这样的代码,我如何让两个run()方法在start()方法的不同线程中运行?
public class Test extends Thread{
@override
public void run(){
//do something
}
public void run(int i){
//do something
}
public static void main(String[] args) {
Test test=new Test();
// test.start()
// How Can I let the two run() methods run in different thread?
}
}
Run Code Online (Sandbox Code Playgroud)