gaurav414u
BAN USER
Comments (3)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
yes, you are partially right. The explanation to this is:
as in ArrayList each element will be stored as its corresponding wrapper class, i.e. int as Integer, float as Float, double as Double, and hence now we may apply:
if(element instanceof yourwrapper_datatype)
{
//do stuff
}
Comment hidden because of low score. Click to expand.
0
of 0 vote
Dude: I think you didnt get the question the right way. The solution you have provided goes for these kind of loops:
Notice that the lengths of inner loops are not independent, these are depending on the iterating variables of the outer loops.
for (i = 0; i < m; i++)
for (j = 1; j < n; j++)
for (k = 2; k < l; k++)
sum++;
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
- gaurav414u May 04, 2017