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
A screen capture is a digital image of your screen, as if you took a picture of it with a camera. For instance, you might want t
GrogVix [38]

The given narration talks about the different means of taking a screen capture on a Windows environment.

<h3>What is a Screen Capture?</h3>

This refers to the process where the content of a screen is captured in a digital image form that is saved in the Documents of the computer as a screenshot.

Hence, we can see that the author mentioned the various ways of using the snipping tool to capture whole or part screens and the precise procedure on how to do it.

Read more about screen capture here:

brainly.com/question/22654940

#SPJ1

5 0
2 years ago
Using your favorite imperative language, give an example of each of the following. (a) A lexical error, detected by the scanner
Travka [436]

Explanation:

a. int foo+; (foo+ is an invalid identifier because + is not a valid char in identifiers)

b. foo int; (Syntax error is any error where the syntax is invalid - either due to misplacement of words, bad spelling, missing semicolons etc.)

c. Static semantic error are logical errors. for e.g passing float as index of an array - arr[1.5] should be a SSE.

d. I think exceptions like NullReferenceException might be an example of DME. Not completely sure but in covariant returns that raise an exception at compile time (in some languages) might also come in this category. Also, passing the wrong type of object in another object (like passing a Cat in a Person object at runtime might qualify for DME.) Simplest example would be trying to access an index that is out of bounds of the array.

8 0
2 years ago
Preliminaries
Ratling [72]

Answer:

okahsb

Explanation:

8 0
3 years ago
Early photographers take to work with what in order to produce photographs? (Btw this is photography, it just isn't a subject in
Kruka [31]
1, they used to use chemicals.
4 0
3 years ago
Does my computer have virus?
vivado [14]

Answer:

does your toothpaste have salt?

6 0
2 years ago
Read 2 more answers
Other questions:
  • True or False<br><br> The signing of Act 26 made Cyber Harassment of a Child a crime.
    14·1 answer
  • What is the advantage of using Mail Merge Wizard when creating a mail merge?
    12·2 answers
  • How does computer network work in a paragraph
    12·1 answer
  • Software that instructs the computer how to run applications and controls the display/keyboard is know as the
    8·1 answer
  • Based upon what you know
    5·1 answer
  • How major is the technology problem in the United States?
    15·1 answer
  • Vghfthcnbvhghvngjgjvjgkb, kcnjc cnnfjdhd mc Dan Jfhjc cm. Cm n n hdjfjocnkcnd
    10·2 answers
  • The engineering firm you work for is submitting a proposal to create an amphitheater at a state park. Proposals must be submitte
    15·1 answer
  • 6. Python indexes lists beginning with the number 1.<br> True<br><br> False
    15·1 answer
  • What line of business (L'Oréa)?​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!