我该如何解决以下问题 [英] How do I solve the following problem

查看:68
本文介绍了我该如何解决以下问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建一个具有数据成员的类员工:id,name,salary和department。从这个类派生类管理器,其中包含5个下属员工的Arraylist

主要方法:

1.创建经理对象,填写所有详细信息并显示它们

2.使用经理对象,显示HR部门的所有下属员工

3.使用经理对象,按降序显示所有下属员工的工资



我尝试过:



通过使用经理类对象

Create a class employee with data members: id,name ,salary and department.From this class ,derive Class manager which contains an Arraylist of 5 subordinate Employees
In main method:
1. Create an object of manager, populate all the details and display them
2. Using an object of Manager ,display all subordinate Employee of "HR" department
3. Using an object of Manager,display salaries of all subordinate Employees in descending order

What I have tried:

it really seems impossible to do the second part by just using the manager class object

推荐答案

这一切似乎无法完成第二部分如果您使用学习指南来提醒自己如何创建类和类的对象,则可能。请参阅 Java™教程 [ ^ ]以获取进一步的指导。
It is all perfectly possible if you use your study guides to remind yourself how to create classes, and objects of classes. See The Java™ Tutorials[^] for further guidance.


这篇关于我该如何解决以下问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆