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
What is the initial condition in this set of code?
marissa [1.9K]

Answer:An initial condition is an extra bit of information about a differential equation that tells you the value of the function at a particular point. Differential equations with initial conditions are commonly called initial value problems.

The video above uses the example

{

d

y

d

x

=

cos

(

x

)

y

(

0

)

=

−

1

to illustrate a simple initial value problem. Solving the differential equation without the initial condition gives you  

y

=

sin

(

x

)

+

C

.

Once you get the general solution, you can use the initial value to find a particular solution which satisfies the problem. In this case, plugging in  

0

for  

x

and  

−

1

for  

y

gives us  

−

1

=

C

, meaning that the particular solution must be  

y

=

sin

(

x

)

−

1

.

So the general way to solve initial value problems is: - First, find the general solution while ignoring the initial condition. - Then, use the initial condition to plug in values and find a particular solution.

Two additional things to keep in mind: First, the initial value doesn't necessarily have to just be  

y

-values. Higher-order equations might have an initial value for both  

y

and  

y

′

, for example.

Second, an initial value problem doesn't always have a unique solution. It's possible for an initial value problem to have multiple solutions, or even no solution at all.

Explanation:

5 0
2 years ago
Which of the following ensures that dropped packets are resent?
Agata [3.3K]

Answer:

TCP

Explanation:

Transmission control protocol ensures packets loss and performs retransmission

TCP works with Internet Protocol (IP)

TCP/IP defines how computers send data packets to each other.

TCP allows transmission of information in both the direction.

Bit rate :defines the rate at which bits are transferred from one place to another

7 0
3 years ago
Give 3 advantages of using shortcut key, especially in MS Office.
Darina [25.2K]

Answer:

Efficient and time-saving. Using shortcuts makes you more efficient at doing certain tasks on your computer. ...

Multi-tasking. Being a multi-tasker is sometimes required in life. ...

Health benefits.

4 0
3 years ago
Edison wants to purchase a new computer and go to the Caribbean for spring break. The computer is priced at $1,299, and the vaca
Otrada [13]

Answer:

This question is imcomplete, here is the complete question

Edison wants to purchase a new computer and go to the Caribbean for spring break. The computer is priced at $1,299, and the vacation is priced at $750. He has only $1,537 in his checking account, so he cannot afford to purchase both. After much thought, Edison buys the computer and writes a check for $1,299. Identify what role money plays in each of the following parts of the story. Hint: Select each role only once. Role of Money Medium of Exchange Unit of Account Store of Value Edison can easily determine that the price of the computer is more than the price of the vacation. Edison has $1,537 in his checking account. Edison writes a check for $1,299.

Identify what role money plays in each of the following parts of the story.

Explanation:

Brian can effortlessly determine and conclude that the cost of the computer is more than that of the price of the vacation.= Unit of Account

Brian has a total amount of $1,537 in his checking account.= Store of value

Brian then writes a check for $1,299.= Medium of Exchange

5 0
3 years ago
Several of the items below indicate the steps required to add a slide to a presentation. Select those steps and indicate the ord
ss7ja [257]

Answer:

Click on the New Slide icon.  2.

Enter the slide position desired. N/A

Click where you want to add the slide.  1.

Select New Slide from the Tools menu.  3.

Switch to the Normal or Slide Sorter view. 4.

Switch to the Notes or Outline view. 5.

Explanation:

You can never enter the slide position desired, and you need to click on the slide after which you want the new slide to be placed.  Thus, enter the slide position desired is not applicable, and you need to click where you want to add the slide, and more accurately after which. Hence, this is the 1st. Now you need to click on the new slide icon. Then you need to select the new slides from the tools menu. The slide will appear in Normal view, and you can design the slide now as well as add the notes. You can then move to slide sorter view to arrange the slides, or you can arrange from the slide tab as well. Finally to check(edit) the notes and outline you can change the view to notes or Outline view. Hence, the above answer.

Keep in mind that through presenter view, you can make the slide show where you can see the slides and your notes, and the listeners can see the slides only.

7 0
3 years ago
Other questions:
  • To download a webpage, the web browser copies files and transfer them to your ____
    14·2 answers
  • Page orientation can be either landscape or _____.
    13·1 answer
  • Which windows tool can you use to find out if the hard drive is slowing down windows performance?
    9·1 answer
  • The most popular way for hackers to take over hosts today is ________.
    15·2 answers
  • Scientific models can be used for a variety of different purposes. Which of the following statements about scientific models is
    7·2 answers
  • What is it called when two different files generate the same hashing result?
    15·1 answer
  • A consumer is the name for:
    6·2 answers
  • Which of the following behaviors does not harm a company if your employment is terminated?
    9·1 answer
  • _____is used to organize and modify the properties of the current selection.
    6·1 answer
  • What two items must be passed in a tuple to the socket module's connect method in order to connect a socket? (choose two.)
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!