相关试题
单选题 下面关于 Math.random()方法生成的随机数,正确的是哪项( )
单选题 以下关于String类的常见操作中,哪个是方法会返回指定字符ch在字符串中最后一次出置的索引( )
单选题 下列选项中,可以正确实现String初始化的是( )
单选题 下列关于LinkedList类的方法,不是从List接口中继承而来的是( )
单选题 阅读下面的代码:
Public class Example{
Public static void main(String[] args) {
String[] strs = { "Tom", "Jerry", "Donald" };
// foreach循环遍历数组
For (String str : strs) {
Str = "Tuffy";
}
System.out.println(strs[0]+ "," + strs[1] + "," + strs[2]);
}
}
程序的运行结果是( )
单选题 String s=”itcast”;则s.substring(3,4)返回的字符串是以下选项中的那个?( )
单选题 使用Iterator时,判断是否存在下一个元素可以使用以下哪个方法( )
单选题 下列选项中,哪个是程序正确的输出结果?()
Class StringDemo{
Public static void main(String[] args){
String s1 = “a”;
String s2 = “b”;
Show(s1,s2);
System.out.println(s1+s2);
}
Public static void show(String s1,String s2){
S1 = s1 +”q”;
S2 = s2 + s1;
}
}