网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
现有: class Guy { String greet() { return "hi"; } } class Cowboy extends Guy { String greet() { return. "howdy";}} class Wrangler extends Cowboy { String greet() { return "orch!"; } } class Greetings2 { public static void main (String [] args) { Guy g=new Wrangler(); Guy g2=new Cowboy(); Wrangler w2=new Wrangler(); System. out .print (g.greet()+g2.greet()+w2 .greet()); } } 结果是什么?()
- A、 hi hi ouch!
- B、 ouch! howdy ouch!
- C、 hi howdy ouch!
- D、编译失败
- E、运行的咐候有异常抛出
参考答案
更多 “ 现有: class Guy { String greet() { return "hi"; } } class Cowboy extends Guy { String greet() { return. "howdy";}} class Wrangler extends Cowboy { String greet() { return "orch!"; } } class Greetings2 { public static void main (String [] args) { Guy g=new Wrangler(); Guy g2=new Cowboy(); Wrangler w2=new Wrangler(); System. out .print (g.greet()+g2.greet()+w2 .greet()); } } 结果是什么?() A、 hi hi ouch!B、 ouch! howdy ouch!C、 hi howdy ouch!D、编译失败E、运行的咐候有异常抛出” 相关考题
考题
A band or collar on the top end of a boom to which the topping lift,midships guy,and outboard guys are secured,is called the ______.A.collar bandB.guy bandC.pad eye collarD.spider band
考题
现有如下包结构:com|--x||--Alpha.class||||--y||--Beta.class||--Gamma.class和类:classTest{Alphaa;Betab;Gammac;}哪三个必须加入到类Test中,以使其通过编译?()
A.packagey;B.packagecom;C.importcom.x.*;D.importcom.x.y.*
考题
现有如F包结构:com|一一X||一一Alpha.class||||一一yI|一一Beta.class||l--Gamma.class和类:classTest{Alphaa;Betab;Gammac;}哪三个必须加入到类Test中,以使其通过编译?()
A.packagey;B.packagecom;C.importcom.x.y.*;D.importcom.x.*;
考题
现有两个类A,B,以下描述中表示B继承自A的是 ( )A.class A extends BB.class B implements AC.class A implements BD.class B extends A
考题
The safest procedure used to rig a guy and preventer is to have the guy ______.A.and preventer have equal stressB.stronger than the preventer to minimize the danger of separationC.take a lighter load than the preventer as a safety factorD.take the stress in case the preventer parts
考题
If the cargo gear on your vessel is equipped with a regular guy and a preventer guy,you should ______.A.Let the schooner guy take most of the strain,thus transferring the load to the opposite boomB.Leave the preventer guy slackC.Secure them as close together as possible on deckD.Secure them so the angle between them is 90° at the boom head
考题
现有包结构: com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class 和类: //insert code here import com.*; import com.x.y.*; class Test { Alpha a; Beta b; Gamma c; } 哪两行分别插入后可允许代码编译?() A、package com.;B、import com.x;C、package com.x;D、import com.x.Alpha;
考题
现有如下包结构: com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class 和类: class Test { Alpha a; Beta b; Gamma c; } 哪三个必须加入到类 Test 中,以使其通过编译?()A、package y;B、package com;C、import com.x.*;D、import com.x.y.*
考题
现有: class TestApp{ public static void main (String[] args){ for (int i=0; iA、0123B、012456789C、0123456789D、012
考题
现有: class A {public String name="a"} class B extends A {public String name="b"} 执行如下代码后的结果是哪项?() A a=new B(); System.out.println(a.name); A、 aB、 bC、编译失败D、运行时抛出异常
考题
现有: class Guy {String greet() {return "hi"; } } class Cowboy extends Guy ( String greet() ( return "howdy ¨; ) ) class Surfer extends Guy (String greet() (return "dude! ";)) class Greetings { public static void main (String [] args) { Guy [] guys = ( new Guy(), new Cowboy(), new Surfer() ); for (Guy g: guys) System.out.print (g.greet()}; } } 结果为:() A、 hi howdy dude!B、运行时异常被抛出。C、第7行出现一个错误,编译失败。D、第8行出现一个错误,编译失败。
考题
单选题The purpose of a preventer as it is used on a conventional yard and stay cargo rig is to().A
allow greater than normal loads to be handled by the gearB
act as an inboard guy in the event the inboard guy parts during cargo handlingC
assist the outboard guy in supporting stresses during cargo handlingD
prevent the inboard guy from parting due to stresses during cargo handling
考题
单选题class Guy{String greet(){return “hi“}} class Cowboy extends Guy {String greet(){return“howdy”}} class Surfer extends Guy {String greet(){return“dudel”}} class Greetings{ public static void main (string[]args){ Guy[] guy= {new Guy(),new Cowboy(),new Surfer()}; for(Guy 0: guys) System.out.print(g.green()); } } 结果为:A
运行时异常被输出B
第7行出现一个错误,编译失败C
第8行出现一个错误,编译失败D
hi hi hiE
hi hawdy doude
考题
单选题If the cargo gear on your vessel is equipped with a regular guy and a preventer guy,you should().A
let the schooner guy take most of the strain,thus transferring the load to the opposite boomB
leave the preventer guy slackC
secure them as close together as possible on deckD
secure them so the angle between them is 90°at the boom head
考题
单选题现有: 1. interface Animal { 2. void eat(); 3. } 4. 5. // insert code here 6. 7. public class HouseCat extends Feline { 8. public void eat() { } 9. } 和五个声明: abstract class Feline implements Animal { } abstract class Feline implements Animal { void eat(); } abstract class Feline implements Animal { public void eat(); } abstract class Feline implements Animal { public void eat() { } } abstract class Feline implements Animal { abstract public void eat(); } 分别插入到第5行,有几个可以通过编译?()A
0B
1C
2D
3
考题
单选题The preventer guy,as used on a conventional yard and stay rig,().A
is rigged at an angle of 70°to 90°from the guy it assistsB
takes the strain imposed on the schooner guy when burtoning cargoC
is rigged when lifting cargo that exceeds the SWL of a single whipD
should take the strain if the regular guy parts
考题
单选题现有: class Guy { String greet() { return "hi"; } } class Cowboy extends Guy { String greet() { return. "howdy";}} class Wrangler extends Cowboy { String greet() { return "orch!"; } } class Greetings2 { public static void main (String [] args) { Guy g=new Wrangler(); Guy g2=new Cowboy(); Wrangler w2=new Wrangler(); System. out .print (g.greet()+g2.greet()+w2 .greet()); } } 结果是什么?()A
hi hi ouch!B
ouch! howdy ouch!C
hi howdy ouch!D
编译失败E
运行的咐候有异常抛出
考题
多选题现有: public class TestDemo{ private int X-2; static int y=3; public void method(){ final int i=100; int j =10; class Cinner { public void mymethod(){ //Here } } } } 在Here处可以访问的变量是哪些?()AXByCjDi
考题
单选题The safest procedure used to rig a guy and preventer is to have the guy().A
and preventer have equal stressB
stronger than the preventer to minimize the danger of separationC
take a lighter load than the preventer as a safety factorD
take the stress in case the preventer parts
考题
单选题现有: class Guy {String greet() {return "hi"; } } class Cowboy extends Guy ( String greet() ( return "howdy ¨; ) ) class Surfer extends Guy (String greet() (return "dude! ";)) class Greetings { public static void main (String [] args) { Guy [] guys = ( new Guy(), new Cowboy(), new Surfer() ); for (Guy g: guys) System.out.print (g.greet()}; } } 结果为:()A
hi howdy dude!B
运行时异常被抛出。C
第7行出现一个错误,编译失败。D
第8行出现一个错误,编译失败。
考题
单选题class Guy { String greet() { return "hi "; } } class Cowboy extends Guy { String greet() { return "howdy "; } } class Wrangler extends Cowboy { String greet() { return "ouch! "; } } class Greetings2 { public static void main(String [] args) { Guy g = new Wrangler(); Guy g2 = new Cowboy(); Wrangler w2 = new Wrangler(); System.out.print(g.greet()+g2.greet()+w2.greet()); } } 结果是什么?()A
hi hi ouch!B
hi howdy ouch!C
ouch! howdy ouch!D
编译失败
考题
单选题现有: interface Animal { void eat () ; } //insert code here public class HouseCat extends Feline { public void eat() { } } 和五个申明 abstract class Feline implements Animal { } abstract class Feline implements Animal { void eat () ; } abstract class Feline implements Animal { public void eat();} abstract class Feline implements Animal { public void eat() {} } abstract class Feline implements Animal { abstract public void eat();} 结果为:()A
1B
2C
3D
4
考题
单选题In a married falls rig at the after end of a hatch,a boom is rigged in a fore and aft line through its heel.Stresses on the outboard guy will be LEAST if the guy is made fast at a point().A
Abreast the heelB
At right angles to the boom when viewed from aboveC
Aft of the heelD
Forward of the spiderband
考题
单选题现有: class TestApp{ public static void main (String[] args){ for (int i=0; i
A
0123B
012456789C
0123456789D
012
考题
单选题In a married falls rig at the after end of a hatch , a boom is rigged in a fore and aft line through its heel . Stresses on the outboard guy will be least if the guy is made fast at a point().A
abreast the heelB
at right angles to the boom when viewed from aboveC
aft of the heelD
forward of the spiderband
热门标签
最新试卷