following code segment.[ServiceContract]public interface ICustomerService{...}public class CustomerService : ICustomerService{...}The service is self-hosted in a console application. Older client applications access the service at http://contoso.com:8080/

题目

following code segment.[ServiceContract]public interface ICustomerService{...}public class CustomerService : ICustomerService{...}The service is self-hosted in a console application. Older client applications access the service at http://contoso.com:8080/CustomerService/V1.Newer client applications access the service at http://contoso.com:8080/CustomerService/V2.You need to ensure that any client application can access the service at either address.Which code segment should you use?()

A.

B.

C.

D.


相似考题
更多“following code segment.[ServiceContract]public interface ICustomerService{...}public class ”相关问题
  • 第1题:

    阅读以下说明和Java程序,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。
    【说明】
    以下Java代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分接口、类及其关系如图5-1所示。




    【Java代码】
    interface?DrawCircle?{? //绘制圆形 public(1) ;}class?RedCircle?implements?DrawCircle?{? ?//绘制红色圆形???????public?void?drawCircle(int?radius,intx,?int?y)??{????????????System.out.println("Drawing?Circle[red,radius:"?+?radius?+",x:"?+?x?+?",y:"?+y+?"]");???????}}class?GreenCircle?implements?DrawCircle?{????//绘制绿色圆形??????public?void?drawCircle(int?radius,?int?x,int?y)?{???????????System.out.println("Drawing?Circle[green,radius:"?+radius+",x:?"?+x+?",y:?"?+y+?"]");??????}}abstract?class?Shape?{????//形状? protected? ? (2)???;? ? public?Shape(DrawCircle?drawCircle)?{? ?this.drawCircle=?drawCircle;? ? ? public?abstract?void?draw();}class?Circle?extends?Shape?{? //圆形? ?private?int?x,y,radius;? public?Circle(int?x,int?y,intradius,DrawCircle?drawCircle)?{? ?(3)???;? this.x?=?x;? ? ? this.y?=?y;? ?this.radius?=radius;? }? ? ?public?void?draw()?{? ? drawCircle.? ?(4)? ?;? ? ? }}public?class?DrawCircleMain?{? public?static?void?main(String[]?args)?{? Shape?redCircle=new?Circle(?100,100,10,? (5) );//绘制红色圆形? Shape?greenCircle=new?Circle(200,200,10,(6) );//绘制绿色圆形? ?redCircle.draw(); greenCircle.draw();? ?}}


    答案:
    解析:
    (1)void drawCircle (int radius,int x,int y)
    (2)DrawCircle drawCircle
    (3)super.drawcircle=drawcircle
    (4)drawCircle(radius,x,y)
    (5)new RedCircle()
    (6)new GreenCircle()【解析】
    第一空是填接口里面的方法,在接口的实现里面找,可以发现应该填void drawCircle (int radius,int x,int y)。
    第二空可以根据后面this drawCircle=drawCircle判断,这里应该有一个drawCircle属性,因此应该填)DrawCircle drawCircle。
    第三空这里用super,用super. drawcircle来引用父类的成员。
    第四空调用drawCircle(radius,x,y)方法。
    第五、六空分别创建一个红色圆形对象和一个绿色圆形对象作为Circle里面的实参。

  • 第2题:

    interface中的方法自动就是public的,而且是abstract的


    正确

  • 第3题:

    31、实现interface的方法前一定要用public修饰


    正确

  • 第4题:

    实现interface的方法前一定要用public修饰


    正确

  • 第5题:

    在用class定义一个类时,数据成员和成员函数的默认访问权限是public。


    私有 私有 解析:类中数据成员和成员函数的默认访问权限是private(私有)。

  • 第6题:

    下列说法中,不正确的是()

    A.一个接口interface源程序经过编译后,得到的文件的扩展名一定是.class#B.一个java源程序编译通过后,得到的文件的扩展名一定是.class#C.一个java源程序可以有多个 class类定义,源文件的名字与public class的类名相同,且只能有一个public类,如果没有public类,源文件的名字必须与第一个类的类名相同,扩展名必须是.java#D.一个java源程序可以包含多个class类
    B I/O接口都要接受来自CPU的寻址,所以它的地址总线首先是输入的。但是,有些I/O接口(例如DMA控制器)可以作为总线上的主设备,这样的I/O接口就要输出地址,它的地址总线就是双向的。