Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is java prblem you have a method public int comparation(Object n1, Object n2) { return ((int)n2-(int)n1); it will return positive number if n1 is

This is java prblem

you have a method

public int comparation(Object n1, Object n2) { return ((int)n2-(int)n1);

it will return positive number if n1 is less than n2 thats mean n1 should follow by n2

return negative number if n1 is greater than n2 that means n1 should come after n2 and if it returns 0 that means both are equal

is there anyway to write return statement rather than using return ((int)n2-(int)n1);

i am not sure what is going on using this return statement so if you could give me alternate return statement that easier to understand would be very appriciated.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Find y'. y= |x + X (x) (x) X 1 02x+ 2x 1 O 2x + 1/3 Ex 2x +

Answered: 1 week ago

Question

=+applying to all or most employers and employees?

Answered: 1 week ago

Question

=+associated with political parties and if so, which ones? Are

Answered: 1 week ago