1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vladimir79 [104]
3 years ago
10

How to create a comparator generic type in java.

Computers and Technology
1 answer:
KIM [24]3 years ago
8 0

Answer:

public class Person {

//fields

private int id;

private String name;

private Payment pay;

//constructor

public Person(String name, int id,

int startSal, int startBon){

this.name = name;

this.id = id;

this.pay = new Payment(startSal, startBon);

}

//method get name

public String getName(){

return name;

}

//method get id

public int getId(){

return id;

}

//method get start salary

public int getStartSalary(){

return pay.startSalary;

}

//method get start bonus

public int getStartBonus(){

return pay.startBonus;

}

//inner payment class

private class Payment{

int startSalary;

int startBonus;

public Payment(int sal, int bon){

this.startSalary = sal;

this.startBonus = bon;

You might be interested in
You have just used a command that produced some interesting output on the screen. You would like to save that information into a
Bogdan [553]

Answer: A. > interesting.txt

Explanation: From the command line, one can perform numerous tasks from navigating into a directory, creating a new directory, deleting files, create files, modify files and so on using simple commands. In the scenario above, after using a common which is used to produce an output on the screen, such as the 'echo' command, one may wish to save the file giving the user the ability to access the file later. Since it is stated the file name 'interesting.txt' given to the file does not currently exist, appending the sign > saves the file. If the filename already exists, it will overwrite the existing content.

6 0
3 years ago
You want to plug a keyboard into the back of a computer. you know that you need to plug the keyboard cable into a ps/2 port. whi
Helga [31]

<span>Often referred to as the mouse port or keyboard port, the PS/2 port was developed by </span><span>IBM and is used to connect a computer mouse or keyboard to an IBM compatible computer. <span>Its name originates from the IBM Personal System/2 arrangement of PCs, with which it was propelled in 1987.</span></span>

7 0
3 years ago
Fallon is a new student on campus. Everywhere she goes, she is asked for her 12-digit student number. To memorize her new studen
makvit [3.9K]

Answer:

chunking

Explanation:

Chunking refers to an approach for making more efficient use of short-term memory by grouping information. Chunking breaks up long strings of information into units or chunks. The resulting chunks are easier to commit to memory than a longer uninterrupted string of information.

8 0
4 years ago
The operating system software is necessary for a computer to function. true or false?
inysia [295]

Answer:

Yes.

Explanation:

Technically it depends on how you define "function". Usable? Yes, required. Turn on? No, not required. If there is no OS you'll get an error saying there is no boot disk/drive.

7 0
3 years ago
Tips to identify email scams.
malfutka [58]

Answer:

Explanation:

dont open or sign up to anything that seems to good to be true

7 0
3 years ago
Other questions:
  • To change the tab order in which fields are encountered on a form, click the tab order button on the ____ tab.
    15·1 answer
  • What do you think of explaining to young people, from high school, the legitimacy of copyright and the dangers they can run on t
    11·1 answer
  • Packet ________ is a form of protection for your computer that looks at each packet that comes into your computer network. scree
    15·1 answer
  • Imagine you just bought a cable installation company that routinely treats its residential customers poorly. You want your compa
    11·1 answer
  • WHAT DOES THE WORD MONOCHROME MEAN?
    11·1 answer
  • Which institution developed outside the limits of the written costitution of the united states ?
    14·1 answer
  • Can nano gold be a way possibly reduce or kill cancer cell growth?
    13·1 answer
  • Does anyone else have edge and think its not the awful?
    12·2 answers
  • What data type would you use for a decimal number?* ​
    9·1 answer
  • Please help me to creat flow chart​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!