public class X { public static void main (String[]args) { string s = new string (“Hello”); modify(s); System.out.printIn(s); } public static void modify (String s) { s += “world!”; } } What is the result?()
1. interface TestA { String toString(); } 2. public class Test { 3. public static void main(String[] args) { 4. System.out.println(new TestA() { 5. public String toString() { return “test”; } 6. } 7. } 8. } What is the result?()
public class Plant { private String name; public Plant(String name) { this.name = name; } public String getName() { return name; } } public class Tree extends Plant { public void growFruit() { } public void dropLeaves() { } } Which is true?()
public class Test { public static void main (String args) { string foo = “blue”; string bar = foo; foo = “green”; System.out.printIn(bar); } } What is the result?()
下面程序的输出结果是() public class Test{ public static void main(String[] args){ String s = “abc dsf ghi”; String[] arr = s.split(“\s”); System.out.println(arr.length); } }
public class Test { public static void main(String[] args) { String str = NULL; System.out.println(str); } } What is the result?()
public class TestString 1 { public static void main(String[] args) { String str = “420”; str += 42; System.out.print(str); } } What is the output?()
public class Test { public static void replaceJ(string text) { text.replace (‘j’, ‘l’); } public static void main(String args[]) { string text = new String (“java”) replaceJ(text); system.out.printIn(text); } } What is the result?()
public class Test { public static void main (String [] args) { string foo = “blue”; string bar = foo; foo = “green”; System.out.printIn(bar); } } What is the result?()
public class test( public static void main(string[]args){ string foo = args [1]; string foo = args [2]; string foo = args [3]; } ) And command line invocation: Java Test red green blue What is the result?()
执行以下代码,输出结果的结果是? () public class Test{ public String[] ss = new String[5]; public static void main(String[] args){ System.out.println(ss[1]); } }
public class X { public static void main (Stringargs) { string s = new string (“Hello”); modify(s); System.out.printIn(s); } public static void modify (String s) { s += “world!”; } } What is the result?()
存在以下JavaBean和JSP页面:Person.java:package x;public class Person {String name;public String getName() {return name;}public void setName(String name) {this.name = name;}}index.jsp:访问http://localhost:8080/项目名/index.jsp?name=John时的页面输出为
读代码:public class foo {static String s;public static void main (String[]args) {System.out.println (“s=” + s);}}结果是:
对于如下代码,下列哪个叙述是正确的?public class E {public static void main (String args[]) {String s1 = args[1];String s2 = args[2];String s3 = args[3];System.out.println(s3);}}
读代码:public class Test {public static void main (String [] args) {String foo = “blue”;String bar = foo;foo = “green”;System.out.println(bar);}}结果是:
public String getAbsolutePath() 获取文件的绝对路径。()
以下代码的运行结果是哪一项。_________ public class StringTest { public static void mb_operate(String x, String y) { x.concat(y); y = x; } public static void main(String args[]) { String a = \A
File类的构造方法public File(String parent, String child)中,参数child是( )
分析如下所示的Java代码,则选项中的说法正确的是( )。 class Parent{ public String name; public Parent(String pName){ this.name = pName; } } public class Test extends Parent { //1 public Test(String Name){ //2 name=\hello
下列程序输出结果为()。 public class test { public static void main (String args[]) {
下列语句输出结果为()。 public class test{ public static void main(String args[]) String s1
Given the uncompleted code of a class:class Person { String name, department; int age; public Person(String n){ name = n; } public Person(String n, int a){ name = n; age = a; } public Person(String n,
下列程序运行后的输出结果是_public class Foo{ public static void main(String[] args){ String s; System.out.println(“s=” + s); }}()