2022Java笔试题及答案2022年Java笔试题及答案在当下,java是通用的计算机语言程序,那么java笔试你知道多少呢
下面跟yjbys我一起来看看最新java笔试试题及答案,希望对大家有所帮助
一、单项选择题1
Java是从()语言改进重新设计
PasacalD
BASIC第1页共20页答案:B2
下列语句哪一个正确()A
Java程序经编译后会产生machinecodeB
Java程序经编译后会产生bytecodeC
Java程序经编译后会产生DLLD
以上都不正确答案:B3
下列说法正确的有()A
class中的constructor不行省略第2页共20页B
constructor必需与class同名,但方法不能与class同名C
constructor在一个对象被new时执行D
一个class只能定义一个constructor答案:C详解:见下面代码,很明显方法是可以和类名同名的,和构造方法唯一的区分就是,构造方法没有返回值
packagenet
study;publicclassTestConStructor{第3页共20页publicTestConStructor(){System
println("constructor");}publicvoidTestConStructor(){System
println("notconstructor");}publicstaticvoidmain(String[]args)第4页共20页{TestConStructortestConStructor=newTestConStructor();System
println("main");testConStructor
TestConStructor();}}4
提供Java存取数据库实力的包是()A