当前位置:SCJP程序员认证考试题库

问题:

[多选]

Given the following code fragment:    
public void create() {    
Vector myVect;    
myVect = new Vector();     
} 
Which of the following statements are true?() 

A .  The declaration on line 2 does not allocate memory space for the variable myVect.
B .  The declaration on line 2 allocates memory space for a reference to a Vector object.
C .  The statement on line 2 creates an object of class Vector.
D .  The statement on line 3 creates an object of class Vector.
E .  The statement on line 3 allocates memory space for an object of class Vector.

Sitemap有什么作用?创建Sitemap有什么目的?() 让搜索引擎全面收录你的站点网页地址。 让搜索引擎了解你的站点网页地址的权重分布。 让搜索引擎了解你的站点内容更新情况。 以上都正确。 18世纪中后期()音乐家开始歌剧改革,将剧情因素引入了序曲。 美国。 法国。 德国。 意大利。 在英美法系国家中,主要存在的证据规则有哪些? 在幼儿园,美术教育内容一般可分为()、()、()三大方面。 某工程采用DBB模式建设,则项目总进度目标的控制是()的任务。 工程总承包方项目管理。 业主方项目管理。 业主方与工程总承包方。 业主方与施工方。

Given the following code fragment:    
public void create() {    
Vector myVect;    
myVect = new Vector();     
} 
Which of the following statements are true?() 

参考答案:

  参考解析

SL-275中指出:要为一个新对象分配空间必须执行new Xxx()调用,new调用执行以下的操作: 
1.为新对象分配空间并将其成员初始化为0或者null。 
2.执行类体中的初始化。(例如在类中有一个成员声明int a=10;在第一步后a=0 ,执行到第二步后a=10)    
3.执行构造函数。 
4.变量被分配为一个到内存堆中的新对象的引用。

在线 客服