网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
Given: 1.package test; 2. 3.class Target { 4.public String name = "hello";5.} What can directly access and change the value of the variable name?()
A
any class
B
only the Target class
C
any class in the test package
D
any class that extends Target
参考答案
参考解析
解析:
暂无解析
更多 “单选题Given: 1.package test; 2. 3.class Target { 4.public String name = "hello";5.} What can directly access and change the value of the variable name?()A any classB only the Target classC any class in the test packageD any class that extends Target” 相关考题
考题
已知如下类说明: public class Test { private float f = 1.0f; int m = 12; static int n=1; public static void main(String arg[]) { Test t = new Test(); // 程序代码… } } 如下哪个使用是正确的?()
A.t.fB.this.nC.Test.mD.Test.n
考题
package test;class Target{public String name=hello;}What can directly access and change the value of the variable name?()
A.any classB.only the Target classC.any class in the test packageD.any class that extends Target
考题
publicclassTest{publicstaticvoidmain(String[]args){booleanassert=true;if(assert){System.out.println(”assertistrue”);}}}Given:javac-source1.3Test.javaWhatistheresult?()
A.Compilationfails.B.Compilationsucceedswitherrors.C.Compilationsucceedswithwarnings.D.Compilationsucceedswithoutwarningsorerrors.
考题
Given:What can directly access and change the value of the variable name?()
A. any classB. only the Target classC. any class in the test packageD. any class that extends Target
考题
Given:Which regular expression, inserted at line 12, correctly splits test into Test A, Test B, and Test C?()
A.String regex=;B.String regex= .;C.String regex=.*;D.String regex=\\s;E.String regex=\\.\\s*;F.String regex=\\w[\.]+;
考题
下列程序的输出结果是class Test{public static void main(String args[]){int n=7;n
下列程序的输出结果是 class Test{ public static void main(String args[]){ int n=7; n<<=3; n=nn+1|n+2^n+3; n>>=2; System.out.println(n); } }A.0B.-1C.14D.64
考题
已知有下列类的说明,则下列哪个语句是正确的? ( ) public class Test { private float f=1.0f; int m=2; static int n=1; public static void main(String arg[]) { Test t=new Test(); } }A.t.f;B.this,n;C.Test.m;D.Test.f;
考题
执行以下代码会输出什么结果?() public class Test { StringgetStr(String s){ return s + “hello”; } public static void main(String arg[]) { Test t= new Test(); System.out.println(t.getStr(“LiLei/n”)); } } A、 编译报错B、 LiLei helloC、 LiLeihelloD、 无任何输出
考题
Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()A、 An exception is thrown at runtime.B、 1C、 4D、 Compilation fails.E、 0
考题
Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()A、a b cB、1 2 3C、a1b2c3D、a1 b2 c3
考题
1.public class Test { 2.public static void main (String args[]) { 3.class Foo { 4.public int i = 3; 5.} 6.Object o = (Object) new Foo(); 7.Foo foo = (Foo)o; 8.System.out.printIn(foo. i); 9. } 10.} What is the result?() A、 Compilation will fail.B、 Compilation will succeed and the program will print “3”C、 Compilation will succeed but the program will throw a ClassCastException at line 6.D、 Compilation will succeed but the program will throw a ClassCastException at line 7.
考题
11. String test = “Test A. Test B. Test C.”; 12. // insert code here 13. String[] result = test.split(regex); Which regular expression inserted at line 12 will correctly split test into “Test A,” “Test B,” and “Test C”?()A、 String regex = “”;B、 String regex = “ “;C、 String regex = “.*“.D、 String regex = “//s”E、 String regex = “//.//s*”;F、 String regex = “//w[ /.] +“;
考题
Given: 11.String test = "Test A. Test B. Test C."; 12.// insert code here 13.String[] result = test.split(regex); Which regular expression, inserted at line 12,correctly splits test into "Test A","Test B",and "Test C"?()A、String regex = "";B、String regex = " ";C、String regex = ".*";D、String regex = "//s";E、String regex = "//.//s*";
考题
单选题Given: 11.String test = "Test A. Test B. Test C."; 12.// insert code here 13.String[] result = test.split(regex); Which regular expression, inserted at line 12,correctly splits test into "Test A","Test B",and "Test C"?()A
String regex = ;B
String regex = ;C
String regex = .*;D
String regex = //s;E
String regex = //.//s*;
考题
单选题Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()A
a b cB
1 2 3C
a1b2c3D
a1 b2 c3
考题
单选题Given: 1.package test; 2. 3.class Target { 4.public String name = "hello";5.} What can directly access and change the value of the variable name?()A
any classB
only the Target classC
any class in the test packageD
any class that extends Target
考题
单选题package test; class Target{ public String name="hello"; } What can directly access and change the value of the variable name?()A
any classB
only the Target classC
any class in the test packageD
any class that extends Target
考题
单选题以target.test.com所在网络上的所有个IP地址为目标,通过秘密SYN扫描方式,探测所有活动主机的命令为()。A
nmap -ss -o target.test.com/24B
nmap -sU -O target.test.com/24C
nmap -sS -O target.test.com/24D
nmap -iR -O target.test.com/24
考题
单选题Given a class Repetition: 1.package utils; 2. 3.public class Repetition{ 4.public static String twice(Strings){returns+s;} 5.} and given another class Demo: 1.//insert code here2. 3.public class Demo{ 4.public static void main(String[]args){ 5.System.out.println(twice("pizza")); 6.} 7.} Which code should be inserted at line 1 of Demo.java to compile and run Demo to print“pizzapizza”?()A
import utils.*;B
static import utils.*;C
importutils.Repetition.*;D
static importutils.Repetition.*;E
import utils.Repetition.twice();F
import static utils.Repetition.twice;G
static import utils.Repetition.twice;
考题
单选题Given: 11.String test = "This is a test"; 12.String[] tokens = test.split("/s"); 13.System.out.println(tokens.length); What is the result?()A
0B
1C
4D
Compilation fails.
考题
单选题Given: 11. String test = "This is a test"; 12. String[] tokens = test.split("/s"); 13. System.out.println(tokens.length); What is the result?()A
An exception is thrown at runtime.B
1C
4D
Compilation fails.E
0
考题
单选题执行以下代码会输出什么结果?() public class Test { StringgetStr(String s){ return s + “hello”; } public static void main(String arg[]) { Test t= new Test(); System.out.println(t.getStr(“LiLei/n”)); } }A
编译报错B
LiLei helloC
LiLeihelloD
无任何输出
考题
单选题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, String d, int a) { // doing the same as two arguments version of constructor // including assignment name=n,age=a department = d; } } Which expression can be added at the "doing the same as..." part of the constructor?()A
Person(n,a);B
this(Person(n,a));C
this(n,a);D
this(name,age);
考题
单选题package test; class Target { public String name = “hello”; } What can directly access and change the value of the variable name?()A
any classB
only the Target classC
any class in the test packageD
any class that extends Target
考题
单选题1.public class Test { 2.public static void main (String args[]) { 3.class Foo { 4.public int i = 3; 5.} 6.Object o = (Object) new Foo(); 7.Foo foo = (Foo)o; 8.System.out.printIn(foo. i); 9. } 10.} What is the result?()A
Compilation will fail.B
Compilation will succeed and the program will print “3”C
Compilation will succeed but the program will throw a ClassCastException at line 6.D
Compilation will succeed but the program will throw a ClassCastException at line 7.
考题
单选题11. String test = “Test A. Test B. Test C.”; 12. // insert code here 13. String[] result = test.split(regex); Which regular expression inserted at line 12 will correctly split test into “Test A,” “Test B,” and “Test C”?()A
String regex = “”;B
String regex = “ “;C
String regex = “.*“.D
String regex = “//s”E
String regex = “//.//s*”;F
String regex = “//w[ /.] +“;
考题
单选题Given: Which regular expression, inserted at line 12, correctly splits test into "Test A", "Test B", and "Test C"?()A
String regex="";B
String regex=" .";C
String regex=".*";D
String regex="//s";E
String regex="//.//s*";F
String regex="//w[/.]+";
热门标签
最新试卷