思迁数码科技Java软件工程师笔试真题
2021-08-10 07:39:03华夏高考网1:Which statements about Java code security are not true?
A.The bytecode verifier loads all classes needed for the execution of a program.
B.Executing code is performed by the runtime interPter.
C.At runtime the bytecodes are loaded, checked and run in an interPter.
D.The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.
2:What is the result when you compile and run the following code?
public class Test
{
public void method()
{
for(int i = 0; i < 3; i++)
{
System.out.print(i);
}
System.out.print(i);
}
}
Choices:
What is the result when you compile and run the following code?
public class Test
{
public void method()
{
for(int i = 0; i < 3; i++)
{
System.out.print(i);
}
System.out.print(i);
}
}
Choices:
A.0122
B.0123
C.Compilation error
D.None of these
3:
Give the following code:
public class Example{
public static void main(String args[] ){
int l=0;
do{
System.out.println(“Doing it for l is:”+l);
}while(--l>0)
System.out.println(“Finish”);
}
}
Which well be output:
Give the following code:
public class Example{
public static void main(String args[] ){
int l=0;
do{
System.out.println(“Doing it for l is:”+l);
}while(--l>0)
System.out.println(“Finish”);
}
}
Which well be output:
A.Doing it for l is 3
B.Doing it for l is 1
C.Doing it for l is 2
D.Doing it for l is 0
4:Math.round(11.5)等於多少?
A.11
B.12
C.11.5
D.none
5:
What will happen when you attempt to compile and run the following code?
int Output = 10;
boolean b1 = false;
if((b1 == true) && ((Output += 10) == 20))
{
System.out.println("We are equal " + Output);
}
else
{
System.out.println("Not equal! " + Output);
}
Choices:
What will happen when you attempt to compile and run the following code?
int Output = 10;
boolean b1 = false;
if((b1 == true) && ((Output += 10) == 20))
{
System.out.println("We are equal " + Output);
}
else
{
System.out.println("Not equal! " + Output);
}
Choices:
A.Compilation error, attempting to perform binary comparison on logical data type
B.Compilation and output of "We are equal 10".
C.Compilation and output of "Not equal! 20".
D.Compilation and output of "Not equal! 10".
6:
What will happen when you attempt to compile and run the following code?
(Assume that the code is compiled and run with assertions enabled.)
public class AssertTest{
public void methodA(int i){
assert i >= 0 : methodB();
System.out.println(i);
}
public void methodB(){
System.out.println("The value must not be negative");
}
public static void main(String args[]){
AssertTest test = new AssertTest();
test.methodA(-10);
}
}
What will happen when you attempt to compile and run the following code?
(Assume that the code is compiled and run with assertions enabled.)
public class AssertTest{
public void methodA(int i){
assert i >= 0 : methodB();
System.out.println(i);
}
public void methodB(){
System.out.println("The value must not be negative");
}
public static void main(String args[]){
AssertTest test = new AssertTest();
test.methodA(-10);
}
}
A.it will print -10
B.it will result in AssertionError showing the message-“the value must not be negative”.
相关推荐
中国点击率最高的一篇文章 !2021-12-23 01:49:29
和利时系统高级硬件工程师笔试题和面试题答案2021-08-10 07:39:00
新华信国际信息咨询JAVA工程师笔试题和面试题答案2021-08-10 07:38:47
联合利华(Unilever)校园招聘笔试真题2021-08-10 07:38:45
保山中医药高等专科学校是公办还是民办?(现在学校口碑怎么样)2024-11-23 03:40:02
昆明幼儿师范高等专科学校是公办还是民办?(现在学校口碑怎么样)2024-11-23 03:38:43
广东邮电职业技术学院是公办还是民办?(现在学校口碑怎么样)2024-11-23 03:37:02
武汉民政职业学院是公办还是民办?(现在学校口碑怎么样)2024-11-23 03:36:26
保山学院是公办还是民办?(现在学校口碑怎么样)2024-11-23 03:34:27
和利时系统高级硬件工程师笔试题和面试题答案2021-08-10 07:39:00
新华信国际信息咨询JAVA工程师笔试题和面试题答案2021-08-10 07:38:47
联合利华(Unilever)校园招聘笔试真题2021-08-10 07:38:45
最新发布
图文推荐
益阳师范高等专科学校是公办还是民办?
2024-11-23 03:52:06益阳医学高等专科学校是公办还是民办?
2024-11-23 03:49:47武汉交通职业学院是公办还是民办?(现
2024-11-23 03:48:18河北大学医学部是公办还是民办?(现在
2024-11-23 03:46:07三门峡社会管理职业学院是公办还是民
2024-11-23 03:44:36广东工贸职业技术学院是公办还是民办?
2024-11-23 03:42:42保山中医药高等专科学校是公办还是民
2024-11-23 03:40:02昆明幼儿师范高等专科学校是公办还是
2024-11-23 03:38:43