文件名称:1
介绍说明--下载内容来自于网络,使用问题请自行百度
编写三个类:Goods,Car,每个类中都有一个方法display(),分别用于显示商品的名称(name),车的品牌(brand)。编写一个类TestVector,包含一个Vector成员变量objectVector,一个成员方法addObject( )用于加入对象到objectVector中,一个成员方法displayObject()用于显示对象obj(如果是商品就显示name,是汽车就显示车的品牌brand),要求在TestVector的主方法中,调用addObject( )方法往objectVector中分别加入多个Goods对象,Car对象,再调用displayObject( )方法显示objectVector的各个对象的属性值。-Write three categories: Goods, Car, each class has a method display (), respectively, is used to display the name of the product (name), the car brand (brand). Write a class TestVector, member variable contains a Vector objectVector, a member method addObject () is used to add objects to the objectVector in a member method displayObject () is used to display the object obj (if the commodity on the show name, the show car is a car brand brand), requires TestVector main method, call the addObject () method to objectVector objects were added to multiple Goods, Car object, calls displayObject () method to display objectVector each object' s property values.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
1.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.