这显然是家庭作业,但你似乎没有在课堂上给予足够的重视或阅读有关如何用Java编程的任何内容。试图帮助不愿意付出努力的人的最大问题是,他们不了解答案,或者觉得有必要与试图帮助他们的人争论。 :P
另一个令人沮丧的是,那些不做这项工作的学生往往甚至不感谢他们的帮助。 ;)
I need to make a code of an employee record.
您应该从一个表示记录必须包含的所有字段的类开始。
a) choice 1 -> add employee
你需要一个集合类。如果你不能使用ArrayList,你必须编写自己的集合,至少支持添加(员工记录)
a.1) employee name a.2) employee age a.3) employee phone number
这是你的三个领域。
b) choice 2 -> Delete employee record(s)
您的收藏需要删除方法。
c) Choice 3 -> Sort employee record alphabetically
我认为这是名字。我还假设他们的意思是ASCIIbetically,因为这更简单。你可能想问。
(2) If user chooses choice1, the input data is stored in an ARRAY (or ARRAYLIST) until the user chooses to stop inputting data.
您需要一个停止或退出的选项。
Kindly help me. I don't know whether to use multi-dimensional ARRAYS (or ARRAYLIST) for this.
我当然不会将Java用于面向对象的编程,我建议你使用Objects(你的集合可能是对象的引用数组)
Specifically, I don't know how I'm gonna store the STRING (employee name) data with the INTEGER (employee age/phone number) data.
Java区分大小写,因此您可以使用String但不使用STRING。我会使用int而不是Integer或INTEGER。
Additionally, kindly educate me about Parallel Sorting of the data for the Array (Name and phone numbers). I couldn't do it..
如果您想知道ArrayList或Collections.sort()如何工作,您只需要阅读代码!