Question: How can i cast Integer to int? I was working in eclipse and the casting to (int) worked. but when i changed it into eclipse

How can i cast Integer to int?

 How can i cast Integer to int? I was working in

I was working in eclipse and the casting to (int) worked.

but when i changed it into eclipse it says I can't cast Integer into int.

So I deleted the (int) and it says I cannot compare Object with Object

the given arraylist is

private Integer[]theItems;

sorting array public void sort int j boolean flag true set flag to true to begin first pass Integer temp //holding variable while flag flag false //set flag to false awaiting a possible swap for j 0; size -1: j++ if int) the Items [j]> (int) the Items [j+l] temp the Items the Items [j] the Items [j+1] the Items [j+1] temp //change element order flag true

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!