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]
2 years ago
10

How to create a comparator generic type in java.

Computers and Technology
1 answer:
KIM [24]2 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
There are two kinds of emotions: positive and negative. True False
fgiga [73]

Answer:

False

Explanation:

There are many emotions the human brain can experience

6 0
2 years ago
Read 2 more answers
Your license can be canceled if you __________
Elena L [17]
Its B i think hope this helps ! 
8 0
3 years ago
Read 2 more answers
You open a web page and log into your email. The traffic travels over many routers. What protocol will the routers use to determ
exis [7]

Answer:

Border Gateway Protocol is a protocol the routers use to determine the most optimal path to forward the traffic.

Explanation:

BGP is a path vector protocol which chooses the most optimal path. The protocol decides core routing decisions based on path, configuration and network.

This protocol gives all the notification about the status of the connection and router.

It is used to routing in an autonomous system and provides ways to measure the effectiveness of configuration.

6 0
2 years ago
Which feature of a social news sharing website distinguishes it from a social bookmarking website
Crank
The privacy feature i think
4 0
3 years ago
Read 2 more answers
What are the keys in all rows that sit between the touch keys?
AysviL [449]
The keys in all rows that's sit between the touch keys are the stretch key
6 0
3 years ago
Other questions:
  • Within the hardware of the personal computer temporary memory is known as
    10·2 answers
  • Ziffcorp, an it firm, uses a technology that automatically updates the antivirus software in all the computers in the firm whene
    13·1 answer
  • Give one advantage and two disadvantages of using a wireless network
    8·1 answer
  • If you implement a Wireless LAN (WLAN) to support connectivity for laptops in the Workstation Domain, which domain does WLAN fal
    5·1 answer
  • ____ are designed to be used with everyday objects, such as home appliances, gaming consoles, digital cameras, e-readers, digita
    12·1 answer
  • Explain why the intangibility of Software System poses special problems for Software Project Management
    11·1 answer
  • The length property of the String object returns
    15·1 answer
  • Assume phrase= "Peter Piper picked a peck of pickled peppers", What will be returned if phrase.search(/[aeiou]/) is called?
    9·1 answer
  • This project is to mimic a meeting request system by checking the requesting party’s validity, and the number of people attendin
    15·1 answer
  • Question 8 (True/False Worth 3 points)
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!