Java知识分享网 - 轻松学习从此开始!    

Java知识分享网

        
AI编程,程序员挑战年入30~100万高级指南 - 职业规划
SpringBoot+SpringSecurity+Vue权限系统高级实战课程        

IDEA永久激活

Java微信小程序电商实战课程(SpringBoot+VUe)

     

AI人工智能学习大礼包

     

PyCharm永久激活

66套java实战课程无套路领取

     

Cursor+Claude AI编程 1天快速上手视频教程

     

OCJP(1z0-808)试题答案详解 PDF 下载


时间:2021-05-24 09:28来源:http://www.java1234.com 作者:转载  侵权举报
OCJP(1z0-808)试题答案详解 PDF 下载
失效链接处理
OCJP(1z0-808)试题答案详解  PDF 下载


本站整理下载:
提取码:cxx9 
 
 
相关截图:
 
主要内容:


QUESTION 1
Given:
What is the result?
A. 200.0 : 100.0
B. 400.0 : 200.0
C. 400.0 : 100.0
D. Compilation fails.
Correct Answer: C
分析:
Java的参数传递只有值传递,即传递的是实参的一个拷贝。题中t.updatePrice(prt, newPrice)中prt是引用数据类型,值传递的是指向对象的地址,所以实参和形参指向的是同一个
对象。newPrice是基本数据类型,值传递给形参的拷贝和实参没有关系,所以值不会变化。
QUESTION 2
Given the following segment of code :
Which two statements, if either were true, would make the code compile? (Choose two.)
A. Vehicleis aninterfacethatis implementedbytheMotorcycleclass.
B. VehicleandMotorcyclebothimplementtheTransportationinterface
C. Vehicleis a superclass of Motorcycle.
D. Motorcycleis a superclass of Vehicle.
E. VehicleandMotorcyclebothextendtheTransportationsuperclass.
F. Motorcycleis aninterfacethatimplements theVehicleclass.
Correct Answer: AC
分析:
哪两个语句(如果正确)可以使代码通过编译?
A.Vehicle 是一个被 Motorcycle 类实现的接口。
B.Vehicle 和 Motorcycle 都实现了 Transportation 接口。
C.Vehicle 是 Motorcycle 的父类。
D.Motorcycle 是 Vehicle 的父类。
E.Vehicle 和 Motorcycle 都继承了 Transportation 类。
F.Motorcycle 是一个实现了 Vehicle 类的接口。
Vehicle:车辆;Motorcycle:摩托车;Transportation:运输工具;
如果Vehicle是接口,Motorcycle必须是其实现类,如果Vehicle是一个类,Motorcycle必须是其子类,所以AC选项正确。
QUESTION 3
Given the code fragment:
What is the result?
A. May 04, 2014T00:00:00.000

 

------分隔线----------------------------


锋哥推荐