假设这段代码位于一个类的主方法中,会打印出什么结果?( )
System.out.println("hello my friends".split(" ")[0]);my
hellomyfriends
hello
friends
split:将字符串按正则或者字符进行分割,成为数组。
假设这段代码位于一个类的主方法中,会打印出什么结果?( )
System.out.println("hello my friends".split(" ")[0]);my
hellomyfriends
hello
friends