- AddressList(1) 实现技术:java语言
- FPGA-Timing-Function-Model-Analysis_1 IR Drop Analysis and Timing
- net-file-trans 有关网络文件传输的vc网络编程实例
- Simple-VB-OPC-Automation-Example Example use opcServer in VB
- hsbuilder-util-latest-DD-WRT Wiwiz的HotSpot Builder是一个无线/有线热点管理系统
- ssm 使用框架架构起可运行的Javaweb工程(Javaweb works that can be run with the SSM framework)
文件名称:Weapon
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:32.4kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
1)、定义一个抽象类Weapon,该抽象类有两个抽象方法attack(),move():这两个方法分别表示武器的攻击方式和移动方式。
(2)、定义3个类:Tank,Flighter,WarShip都继承自Weapon,分别用不同的方式实现Weapon
类中的抽象方法。
(3)、写一个类Army,代表一支军队,这个类有一个属性是Weapon数组w(用来存储该军队所拥有的所有武器);该类还提供一个构造方法,在构造方法里通过传一个int类型的参数来限定该类所能拥有的最大武器数量,并用这一大小来初始化数组w。该类还提供一个方法addWeapon(Weapon wa),表示把参数wa所代表的武器加入到数组w中。在这个类中还定义两个方法attackAll()和moveAll(),让w数组中的所有武器攻击和移动。
(4)、写一个主方法去测试以上程序。
-1), defines an abstract class Weapon, the abstract class has two abstract methods attack (), move (): These two methods represent the weapons attacks and moves.
(2), defines three classes: Tank, Flighter, WarShip are inherited from the Weapon, respectively, in different ways to achieve Weapon
Class abstract methods.
(3), write a class Army, on behalf of an army, this class has a property is an array of Weapon w (used to store all of the weapons owned by the armed forces) class provides a constructor in the constructor through the mass a parameter of type int to limit the class can have the maximum number of weapons, and to initialize the array with the size of the w. The class also provides a method addWeapon (Weapon wa), that represent the parameters wa added to the array w of weapons. In this class also defines two methods attackAll () and moveAll (), let w array and move all the weapons to attack.
(4), write a main method to test the above procedure.
(2)、定义3个类:Tank,Flighter,WarShip都继承自Weapon,分别用不同的方式实现Weapon
类中的抽象方法。
(3)、写一个类Army,代表一支军队,这个类有一个属性是Weapon数组w(用来存储该军队所拥有的所有武器);该类还提供一个构造方法,在构造方法里通过传一个int类型的参数来限定该类所能拥有的最大武器数量,并用这一大小来初始化数组w。该类还提供一个方法addWeapon(Weapon wa),表示把参数wa所代表的武器加入到数组w中。在这个类中还定义两个方法attackAll()和moveAll(),让w数组中的所有武器攻击和移动。
(4)、写一个主方法去测试以上程序。
-1), defines an abstract class Weapon, the abstract class has two abstract methods attack (), move (): These two methods represent the weapons attacks and moves.
(2), defines three classes: Tank, Flighter, WarShip are inherited from the Weapon, respectively, in different ways to achieve Weapon
Class abstract methods.
(3), write a class Army, on behalf of an army, this class has a property is an array of Weapon w (used to store all of the weapons owned by the armed forces) class provides a constructor in the constructor through the mass a parameter of type int to limit the class can have the maximum number of weapons, and to initialize the array with the size of the w. The class also provides a method addWeapon (Weapon wa), that represent the parameters wa added to the array w of weapons. In this class also defines two methods attackAll () and moveAll (), let w array and move all the weapons to attack.
(4), write a main method to test the above procedure.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
抽象类Weapon/
抽象类Weapon/_4/
抽象类Weapon/_4.sln
抽象类Weapon/_4.suo
抽象类Weapon/_4/Army.cs
抽象类Weapon/_4/bin/
抽象类Weapon/_4/bin/Debug/
抽象类Weapon/_4/bin/Debug/_4.exe
抽象类Weapon/_4/bin/Debug/_4.pdb
抽象类Weapon/_4/bin/Debug/_4.vshost.exe
抽象类Weapon/_4/bin/Debug/_4.vshost.exe.manifest
抽象类Weapon/_4/ClassDiagram1.cd
抽象类Weapon/_4/ClassDiagram2.cd
抽象类Weapon/_4/Flighter.cs
抽象类Weapon/_4/obj/
抽象类Weapon/_4/obj/Debug/
抽象类Weapon/_4/obj/Debug/Refactor/
抽象类Weapon/_4/obj/Debug/TempPE/
抽象类Weapon/_4/obj/Debug/_4.csproj.FileListAbsolute.txt
抽象类Weapon/_4/obj/Debug/_4.exe
抽象类Weapon/_4/obj/Debug/_4.pdb
抽象类Weapon/_4/Program.cs
抽象类Weapon/_4/Properties/
抽象类Weapon/_4/Properties/AssemblyInfo.cs
抽象类Weapon/_4/Tank.cs
抽象类Weapon/_4/WarShip.cs
抽象类Weapon/_4/Weapon.cs
抽象类Weapon/_4/_4.csproj
抽象类Weapon/_4/
抽象类Weapon/_4.sln
抽象类Weapon/_4.suo
抽象类Weapon/_4/Army.cs
抽象类Weapon/_4/bin/
抽象类Weapon/_4/bin/Debug/
抽象类Weapon/_4/bin/Debug/_4.exe
抽象类Weapon/_4/bin/Debug/_4.pdb
抽象类Weapon/_4/bin/Debug/_4.vshost.exe
抽象类Weapon/_4/bin/Debug/_4.vshost.exe.manifest
抽象类Weapon/_4/ClassDiagram1.cd
抽象类Weapon/_4/ClassDiagram2.cd
抽象类Weapon/_4/Flighter.cs
抽象类Weapon/_4/obj/
抽象类Weapon/_4/obj/Debug/
抽象类Weapon/_4/obj/Debug/Refactor/
抽象类Weapon/_4/obj/Debug/TempPE/
抽象类Weapon/_4/obj/Debug/_4.csproj.FileListAbsolute.txt
抽象类Weapon/_4/obj/Debug/_4.exe
抽象类Weapon/_4/obj/Debug/_4.pdb
抽象类Weapon/_4/Program.cs
抽象类Weapon/_4/Properties/
抽象类Weapon/_4/Properties/AssemblyInfo.cs
抽象类Weapon/_4/Tank.cs
抽象类Weapon/_4/WarShip.cs
抽象类Weapon/_4/Weapon.cs
抽象类Weapon/_4/_4.csproj
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.