题目内容

请写出输出结果public class Testjava{public static void main(String[] args){String string = "\\djava\\w{1,}";String s1="66javacode";String s2 = "5javamylove";if(s1.matches(string)){System.out.println(s1);}if(s2.matches(string)){System.out.println(s2);//【代码】}}}

查看答案
更多问题

请说出E类中标注的【代码】的输出结果。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 + "好吃";}}

请说出E类中标注的【代码1】,【代码2】的输出结果。public class E {public static void main(String args[]) {byte d[]="abc我们喜欢篮球".getBytes();System.out.println(d.length); //【代码1】String s=new String(d,0,7);System.out.println(s);//【代码2】}}

请说出E类中标注的【代码】的输出结果。class MyString {public String getString(String s) {StringBuffer str = new StringBuffer();for(int i=0;i

public class Bird {public static void main(String[] args) {String str1="bird";String str2=str1;str1="fly";System.out.println(str2);}}运行结果:

答案查题题库