关于下面的程序Test.java说法正确的是()。public class Test {static String x="1";static int y;public static void main(String args[]) {int z=2;System.out.println(x+y+z);}}
A. 3
B. 12
C. 102
D. 程序有编译错误
查看答案
请写出输出结果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