10道经典java技术基础笔试题

10道经典java技术基础笔试题

长沙牛耳教育      2022-04-28 07:49:01     4

10道经典java技术基础笔试题,1.下列哪一种叙述是正确的(D)A.abstract修饰符可修饰字段、方法和类B.抽象方法的body部分必须用一对大括号{}包住C.声明抽象

课程价格 请咨询

上课时段: 授课校区:

详细介绍

1.下列哪一种叙述是正确的(D)

A.abstract修饰符可修饰字段、方法和类

B.抽象方法的body部分必须用一对大括号{}包住

C.声明抽象方法,大括号可有可无

D.声明抽象方法不可写出大括号

2.如下代码

public class Test { public int aMethod() { static int i = 0; i++; return i; } public static void main (String args[]) { Test test = new Test(); test.aMethod(); int j = test.aMethod(); System.out.println(j); } }

输出结果是什么?D

A.0

B.1

C.2

D.编译失败

3.下列哪种说法是正确的(D)

A.实例方法可直接调用超类的实例方法

B.实例方法可直接调用超类的类方法

C.实例方法可直接调用其他类的实例方法

D.实例方法可直接调用本类的类方法

4.如下代码:

class Super { public Integer getLenght() { return new Integer(4); } }  public class Sub extends Super { public Long getLenght() { return new Long(5); } public static void main(String[] args) { Super sooper = new Super(); Sub sub = new Sub(); System.out.println(sooper.getLenght().toString() + "," + sub.getLenght().toString() ); } }

输出是什么?B

A.4,4

B.4,5

C.5,4

D.5,5

5.在Servlet处理请求的方式为:C

A.以进程的方式

B.以程序的方式

C.以线程的方式

D.以响应的方式

6.JDBC中,用于表示数据库连接的对象是:B

A.Statement

B.Connection

C.DriverManager

D.PreparedStatement

7.用于调用存储过程的对象是:C

A.ResultSet

B.DriverManager

C.CallableStatemet

D.PreparedStatement

8.按照MVC设计模式,JSP用于实现:B

A.Model

B.View

C.Controller

D.容器

9.下面的语句会产生什么样的输出?A

System.out.println(4&7);

A.4

B.5

C.6

D.7

E.0

10.下面哪个不是Java关键字A

A integer

B double

C float

D default

以上就是长沙牛耳教育java培训机构的小编针对“10道经典java技术基础笔试题”的内容进行的回答,希望对大家有所帮助,如有疑问,请在线咨询,有专业老师随时为你服务。

Java笔试题

学分高考提醒您:交易时请核实对方资质,对于过大宣传或承诺需谨慎!任何要求预付定金、汇款等方式均存在风险,谨防上当。