Question: ( 1 0 % ) Consider the following variable declarations: Integer n l = 1 5 ; Integer n 2 = 7 ; Integer n

(10%) Consider the following variable declarations:
Integer nl=15;
Integer n2=7;
Integer n3=15;
String s1= "computer";
String s2= "soda";
String s3= "pencil";
Indicate whether the result of each of the following comparisons is positive, negative, or 0 :
a. n1.compareTo(n2)
b. n3.compareTo(n1)
c. s1.compareTo(s2)
d. s3.compareTo(s1)
 (10%) Consider the following variable declarations: Integer nl=15; Integer n2=7; Integer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!