题目内容

表达式"Bird".compareTo("Bird fly")的值是负数。

A. 对
B. 错

查看答案
更多问题

给出下列【代码】注释标注的代码的输出结果。import java.util.regex.*;public class E {public static void main(String args[ ]) {String s = "10月1日至11月6日禁止通行";String regex = "[0-9]+[月日]";Pattern p =Pattern.compile(regex);Matcher m =p.matcher(s);int count =0;String item ="";while(m.find()) {item = m.group();count ++;}System.out.printf("%d:%s",count,item);//【代码】}}

给出下列【代码】注释标注的代码的输出结果。import java.util.*;public class E {public static void main(String args[]) {String str = "现在时间是20:58:18";str = str.replaceAll("[^0-9:]+","");StringTokenizer fenxi = new StringTokenizer(str,":");int h = Integer.parseInt(fenxi.nextToken());int m = Integer.parseInt(fenxi.nextToken());int s = Integer.parseInt(fenxi.nextToken());System.out.printf("%d:%d:%d",h,m,s);//【代码】}}

给出下列【代码】注释标注的代码的输出结果。public class E {public static void main (String[]args){String str = new String ("苹果");modify(str);System.out.println(str);//【代码】}public static void modify (String s) {s = s + "好吃";}}

给出下列【代码】注释标注的代码的输出结果。import java.util.regex.*;public class E {public static void main(String args[ ]) {String s = "市话12.8元,长途:8.2元,短信10.9";String regex = "[0-9]+[.][0-9]+";Pattern p =Pattern.compile(regex);Matcher m =p.matcher(s);double sum =0;while(m.find()) {String item = m.group();sum = sum+Double.parseDouble(item);}int n = (int)sum;System.out.printf("%d",n);//【代码】}}

答案查题题库