日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java三级考试题库_JAVA题库:格林模拟试题三(下)

發布時間:2024/9/19 编程问答 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java三级考试题库_JAVA题库:格林模拟试题三(下) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

JAVA題庫:格林模擬試題三(下)

分類:計算機等級

|

更新時間:2016-07-08|

來源:轉載

Question?31)

Which?of?the?following?statements?are?true?

1)?The?default?layout?manager?for?an?Applet?is?FlowLayout

2)?The?default?layout?manager?for?a?Frame?is?FlowLayout

3)?A?layout?manager?must?be?assigned?to?an?Applet?before?the?setSize?method?is?called

4)?The?FlowLayout?manager?attempts?to?honor?the?preferred?size?of?any?components

Question?32)

Which?of?the?following?statements?are?true?about?a?variable?created?with?the?static?modifier?

1)?Once?assigned?the?value?of?a?static?variable?may?not?be?altered

2)?A?static?variable?created?in?a?method?will?keep?the?same?value?between?calls

3)?Only?one?instance?of?a?static?variable?will?exist?for?any?amount?of?class?instances

4)?The?static?modifier?can?only?be?applied?to?a?primitive?value

Question?33)

Which?of?the?following?statements?are?true?

1)?Java?uses?a?system?called?UTF?for?I/O?to?support?international?character?sets

2)?The?RandomAccessFile?is?the?most?suitable?class?for?supporting?international?character?sets

3)?An?instance?of?FileInputStream?may?not?be?chained?to?an?instance?of?FileOutputStream

4)?File?I/O?activities?requires?use?of?Exception?handling

Question?34)

What?will?happen?when?you?attempt?to?compile?and?run?the?following?code?

import?java.io.*;

class?ExBase{

abstract?public?void?martley(){

}

}

public?class?MyEx?extends?ExBase{

public?static?void?main(String?argv[]){

DataInputStream?fi?=?new?DataInputStream(System.in);

try{

fi.readChar();

}catch(IOException?e){

System.exit(0);

}

finally?{System.out.println("Doing?finally");}

}

}

1)?Compile?time?error

2)?It?will?run,?wait?for?a?key?press?and?then?exit

3)?It?will?run,?wait?for?a?keypress,?print?"Doing?finally"?then?exit

4)?At?run?and?immediately?exit轉貼于來源:-計算機二級考試 Question?35)

What?will?happen?when?you?attempt?to?compile?and?run?the?following?code

public?class?Borley?extends?Thread{

public?static?void?main(String?argv[]){

Borley?b?=?new?Borley();

b.start();

}

public?void?run(){

System.out.println("Running");

}

}

1)?Compilation?and?run?but?no?output

2)?Compilation?and?run?with?the?output?"Running"

3)?Compile?time?error?with?complaint?of?no?Thread?target

4)?Compile?time?error?with?complaint?of?no?access?to?Thread?package

Question?36)

Assuming?any?exception?handling?has?been?set?up,?which?of?the?following?will?create?an?instance?of?the?RandomAccessFile?class

1)?RandomAccessFile?raf=new?RandomAccessFile("myfile.txt","rw");

2)?RandomAccessFile?raf=new?RandomAccessFile(?new?DataInputStream());

3)?RandomAccessFile?raf=new?RandomAccessFile("myfile.txt");

4)?RandomAccessFile?raf=new?RandomAccessFile(?new?File("myfile.txt"));

uestion?37)

Given?the?following?class?definition

public?class?Upton{

public?static?void?main(String?argv[]){

}

public?void?amethod(int?i){}

//Here

}

Which?of?the?following?would?be?legal?to?place?after?the?comment?//Here??

1)?public?int?amethod(int?z){}

2)?public?int?amethod(int?i,int?j){return?99;}

3)?protected?void?amethod(long?l){?}

4)?private?void?anothermethod(){}來源:-計算機二級考試 uestion?38)

Which?of?the?following?statements?are?true?

1)?Code?must?be?written?if?the?programmer?wants?a?frame?to?close?on?selecting?the?system?close?menu

2)?The?default?layout?for?a?Frame?is?the?BorderLayout?Manager

3)?The?layout?manager?for?a?Frame?cannot?be?changed?once?it?has?been?assigned

4)?The?GridBagLayout?manager?makes?extensive?use?of?the?the?GridBagConstraints?class.

Question?39)

Given?the?following?class?definition

public?class?Droitwich{

class?one{

private?class?two{

public?void?main(){

System.out.println("two");

}

}

}

}

Which?of?the?following?statements?are?true

1)?The?code?will?not?compile?because?the?classes?are?nested?to?more?than?one?level

2)?The?code?will?not?compile?because?class?two?is?marked?as?private

3)?The?code?will?compile?and?output?the?string?two?at?runtime

4)?The?code?will?compile?without?error

Question?40)

Given?the?following?code

class?Base{

static?int?oak=99;

}

public?class?Doverdale?extends?Base{

public?static?void?main(String?argv[]){

Doverdale?d?=?new?Doverdale();

d.amethod();

}

public?void?amethod(){

//Here

}

}

Which?of?the?following?if?placed?after?the?comment?//Here,?will?compile?and?modify?the?value?of?the?variable?oak?

1)?super.oak=1;

2)?oak=33;

3)?Base.oak=22;

4)?oak=50.1;來源:-計算機二級考試 Question?41)

You?are?creating?an?application?that?has?a?form?with?a?text?entry?field?used?to?enter?a?persons?age.?Which?of?the?following?is?appropriate?for?capturing?this?information.

1)?Use?the?Text?field?of?a?TextField?and?parse?the?result?using?Integer

2)?Use?the?getInteger?method?of?the?TextField

3)?Use?the?getText?method?of?a?TextBox?and?parse?the?result?using?the?getInt?method?of?Integer?class

4)?Use?the?getText?method?of?a?TextField?and?use?the?parseInt?method?of?the?Integer?class

Question?42)

Given?the?following?declaration

Integer?i=new?Integer(99);

How?can?you?now?set?the?value?of?i?to?10?

1)?i=10;

2)?i.setValue(10);

3)?i.parseInt(10);

4)?none?of?the?above

Question?43)

Which?of?the?following?statements?are?true

1)?constructors?cannot?be?overloaded

2)?constructors?cannot?be?overridden

3)?a?constructor?can?return?a?primitive?or?an?object?reference

4)?constructor?code?executes?from?the?current?class?up?the?hierarchy?to?the?ancestor?class

Question?44)

Given?a?reference?called

t

to?a?class?which?extends?Thread,?which?of?the?following?will?cause?it?to?give?up?cycles?to?allow?another?thread?to?execute.

1)?t.yield();

2)?Thread.yield();

3)?yield(100);?//Or?some?other?suitable?amount?in?milliseconds

4)?yield(t);來源:-計算機二級考試 Question?45)

What?will?happen?when?you?attempt?to?compile?and?run?the?following?code?

public?class?Sandys{

private?int?court;

public?static?void?main(String?argv[]){

Sandys?s?=?new?Sandys(99);

System.out.println(s.court);

}

Sandys(int?ballcount){

court=ballcount;

}

}

1)?Compile?time?error,?the?variable?court?is?defined?as?private

2)?Compile?time?error,?s?is?not?initialized?when?the?System.out?method?is?called

3)?Compilation?and?execution?with?no?output

4)?Compilation?and?run?with?an?output?of?99

Question?46)

Which?of?the?following?statements?are?true?

1)?A?method?cannot?be?overloaded?to?be?less?public?in?a?child?class

2)?To?be?overridden?a?method?only?needs?the?same?name?and?parameter?types

3)?To?be?overridden?a?method?must?have?the?same?name,?parameter?and?return?types

4)?An?overridden?method?must?have?the?same?name,?parameter?names?and?parameter?types

Question?47)

What?will?happen?when?you?attempt?to?compile?and?run?the?following?code?

class?Base{

Base(){

System.out.println("Base");

}

}

public?class?Checket?extends?Base{

public?static?void?main(String?argv[]){

Checket?c?=?new?Checket();

super();

}

Checket(){

System.out.println("Checket");

}

}

1)?Compile?time?error

2)?Checket?followed?by?Base

3)?Base?followed?by?Checket

4)?runtime?error來源:-計算機二級考試 Question?48)

Which?of?the?following?statements?are?true?

1)?Static?methods?cannot?be?overriden?to?be?non?static

2)?Static?methods?cannot?be?declared?as?private

3)?Private?methods?cannot?be?overloaded

4)?An?overloaded?method?cannot?throw?exceptions?not?checked?in?the?base?class

Question?49)

Which?of?the?following?statements?are?true?

1)?The?automatic?garbage?collection?of?the?JVM?prevents?programs?from?ever?running?out?of?memory

2)?A?program?can?suggest?that?garbage?collection?be?performed?but?not?force?it

3)?Garbage?collection?is?platform?independent

4)?An?object?becomes?eligible?for?garbage?collection?when?all?references?denoting?it?are?set?to?null.

Question?50)

Given?the?following?code

public?class?Sytch{

int?x=2000;

public?static?void?main(String?argv[]){

System.out.println("Ms?"+argv[1]+"Please?pay?$"+x);

}

}

What?will?happen?if?you?attempt?to?compile?and?run?this?code?with?the?command?line

java?Sytch?Jones?Diggle

1)?Compilation?and?output?of?Ms?Diggle?Please?pay?$2000

2)?Compile?time?error

3)?Compilation?and?output?of?Ms?Jones?Please?pay?$2000

4)?Compilation?but?runtime?error

Question?51)

What?will?happen?when?you?attempt?to?compile?and?run?the?following?code

class?Base{

protected?int?i?=?99;

}

public?class?Ab{

private?int?i=1;

public?static?void?main(String?argv[]){

Ab?a?=?new?Ab();

a.hallow();

}

abstract?void?hallow(){

System.out.println("Claines?"+i);

}

}

1)?Compile?time?error

2)?Compilation?and?output?of?Claines?99

3)?Compilation?and?output?of?Claines?1

4)?Compilation?and?not?output?at?runtime來源:-計算機二級考試 Question?52)

You?have?been?asked?to?create?a?scheduling?system?for?a?hotel?and?catering?organsiation.

You?have?been?given?the?following?information?and?asked?to?create?a?set?of?classes?to?represent?it.

On?the?catering?side?of?the?organsiation?they?have

Head?Chefs

Chefs

Apprentice?Chefs

The?system?needs?to?store?an?employeeid,?salary?and?the?holiday?entitlement

How?would?you?best?represent?this?information?in?Javae?been?given?the?following?information?and?asked?to?create?a?set?of?classes?to?represent?it.

How?would?you?best?represent?this?information?in?Java

1)?Create?classes?for?Head?Chef,?Chef,?Apprentice?Chef?and?store?the?other?values?in?fields

2)?Create?an?employee?class?and?derive?sub?classes?for?Head?Chef,?Chef,?Apprentice?Chef?and?store?the?other?values?in?fields.

3)?Create?and?employee?class?with?fields?for?Job?title?and?fields?for?the?other?values.

4)?Create?classes?for?all?of?the?items?mentioned?and?create?a?container?class?to?represent?employees

Question?53)

You?need?to?read?in?the?lines?of?a?large?text?file?containing?tens?of?megabytes?of?data.?Which?of?the?following?would?be?most?suitable?for?reading?in?such?a?file

1)?new?FileInputStream("file.name")

2)?new?InputStreamReader(new?FileInputStream("file.name"))

3)?new?BufferedReader(new?InputStreamReader(new?FileInputStream("file.name")));

4)?new?RandomAccessFile?raf=new?RandomAccessFile("myfile.txt","+rw");

Question?54)

What?will?happen?when?you?attempt?to?compile?and?run?the?following?code?

public?class?Inc{

public?static?void?main(String?argv[]){

Inc?inc?=?new?Inc();

int?i?=0;

inc.fermin(i);

i?=?i++;

System.out.println(i);

}

void?fermin(int?i){

i++;

}

}

1)?Compile?time?error

2)?Output?of?2

3)?Output?of?1

4)?Output?of?0來源:-計算機二級考試 Question?55)

What?will?happen?when?you?attempt?to?compile?and?run?the?following?code?

public?class?Agg{

static?public?long?i=10;

public?static?void?main(String?argv[]){

switch(i){

default:

System.out.println("no?value?given");

case?1:

System.out.println("one");

case?10:

System.out.println("ten");

case?5:

System.out.println("five");

}

}

}

1)?Compile?time?error

2)?Output?of?"ten"?followed?by?"five"

3)?Output?of?"ten"

4)?Compilation?and?run?time?error?because?of?location?of?default

Question?56)

Given?the?following?class

public?class?ZeroPrint{

public?static?void?main(String?argv[]){

int?i?=0;

//Here

}

}

Which?of?the?following?lines?if?placed?after?the?comment?//Here?will?print?out?0.

1)?System.out.println(i++);

2)?System.out.println(i+’0’);

3)?System.out.println(i);

4)?System.out.println(i--);

Question?57)

Given?the?following?code

class?Base?{}

class?Agg?extends?Base{

public?String?getFields(){

String?name?=??"Agg";

return?name;

}

}

public?class?Avf{

public?static?void?main(String?argv[]){

Base?a?=?new?Agg();

//Here

}

}

What?code?placed?after?the?comment?//Here?will?result?in?calling?the?getFields?method?resulting?in?the?output?of?the?string?"Agg"?

1)?System.out.println(a.getFields());

2)?System.out.println(a.name);

3)?System.out.println((Base)?a.getFields());

4)?System.out.println(?((Agg)?a).getFields());轉來源:-計算機二級考試 Question?58)

What?will?happen?when?you?attempt?to?compile?and?run?the?following?code.

public?class?Pvf{

static?boolean?Paddy;

public?static?void?main(String?argv[]){

System.out.println(Paddy);

}

}

1)?Compile?time?error

2)?compilation?and?output?of?false

3)?compilation?and?output?of?true

4)?compilation?and?output?of?null

Question?59)

Which?of?the?following?statements?are?true?

1)?The?x,y?coordinates?of?an?instance?of?MouseEvent?can?be?obtained?using?the?getX()?and?getY()?methods

2)?The?x,y?coordinates?of?an?instance?of?MouseEvent?can?be?obtained?using?the?X?and?Y?integer?fields

3)?The?time?of?a?MouseEvent?can?be?extracted?using?the?getTime()?method

4)?The?time?of?a?MouseEvent?can?be?extracted?using?the?getWhen?method

Question?60)

Given?the?following?code

import?java.io.*;

public?class?Ppvg{

public?static?void?main(String?argv[]){

Ppvg?p?=?new?Ppvg();

p.fliton();

}

public?int?fliton(){

try{

FileInputStream?din?=?new?FileInputStream("Ppvg.java");

din.read();

}catch(IOException?ioe){

System.out.println("flytwick");

return?99;

}finally{

System.out.println("fliton");

}

return?-1;

}

}

Assuming?the?file?Ppvg.java?is?available?to?be?read?which?of?the?following?statements?are?true?if?you?try?to?compile?and?run?the?program?

1)?The?program?will?run?and?output?only?"flytwick"

2)?The?program?will?run?and?output?only?"fliton"

3)?The?program?will?run?and?output?both?"fliton"?and?"flytwick"

4)?An?error?will?occur?at?compile?time?because?the?method?fliton?attempts?to?return?two?values來源:-計算機二級考試

總結

以上是生活随笔為你收集整理的java三级考试题库_JAVA题库:格林模拟试题三(下)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 国产一级片自拍 | 久草婷婷| 蜜芽久久 | 最新日韩精品 | 在线激情视频 | 黄色网页在线播放 | 4438全国成人免费 | 久久精品区 | 日本aaa视频 | 50一60岁老妇女毛片 | 国产福利不卡 | 日韩不卡中文字幕 | 911看片| 777四色| 69国产在线 | 91新视频| www插插插无码免费视频网站 | 亚洲欧洲成人 | 91免费在线视频 | a级性生活视频 | 最新在线黄色网址 | 欧美成人精精品一区二区频 | 亚洲天堂影院在线观看 | 女上男下动态图 | 美日韩免费视频 | 乳孔很大能进去的av番号 | 国产黄色在线观看 | 深爱开心激情网 | 色悠悠视频| 中文字幕日韩三级片 | 影音先锋丝袜美腿 | 亲嘴脱内衣内裤 | 久久久久久国产免费a片 | 国产三区精品 | 久草电影网站 | 欧美视频在线一区 | 国产成人99| 97超碰总站| 午夜一级视频 | 人妻偷人精品一区二区三区 | 亚洲图片欧美日韩 | 青青视频免费观看 | 欧美 日韩 国产 高清 | jizzjizz亚洲| 亚洲乱码国产乱码精品精 | 国产精品zjzjzj在线观看 | 亚洲欧美日韩系列 | 日韩激情中文字幕 | 国产午夜大地久久 | 性欧美video另类hd尤物 | 96福利视频 | 国内精品小视频 | 亚欧美| 奇米影视第四色777 波多野结衣一区二区三区免费视频 | 天堂资源网| 日本呦呦 | 精品国产伦一区二区三区免费 | 99国产视频 | 日韩一区二区三 | 黄色动漫在线免费观看 | 亚洲综合视频网站 | 欧美激情一二三 | 欧美日韩一区二区三区视频 | 免费色网址 | 久久综合爱 | 岛国一区二区 | 一级特级黄色片 | 女优一区二区三区 | 中文字幕视频在线观看 | 中文字幕在线导航 | 日本高清视频在线播放 | 国产人妻久久精品一区二区三区 | 久久综合五月婷婷 | 97久久人人 | 黄色亚洲视频 | 日本成人在线播放 | 欧美性狂猛xxxxxbbbbb | 婷婷五月综合缴情在线视频 | 亚洲性影院 | 欧美久久伊人 | 欧美一区二区 | 操欧美老逼| 天堂在线91| a级片久久| 黄色性生活一级片 | 精品免费一区二区 | 不卡免费视频 | 国产一级免费视频 | 国产成人三级在线观看 | 69看片 | 国产成人精品一区二区三区无码熬 | 超碰操 | 一本色道久久综合熟妇 | 在线看污视频 | 国产欧美一区二区三区在线老狼 | 精品国产乱码久久久久久闺蜜 | 伦理片中文字幕 | 日韩av在线第一页 | 老汉色av|