Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to determine min of two int values

 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to determine the min value between two int values?

I have two recordsets that I am getting the row count of each recordset:

int rsRowCount = rs.getRowCount();

int rs1RowCount = rs1.getRowCount();

I need to get the value of the rowcount that is determined to be the min value between the two.

Any help or direction would be greatly appreciated.

Regards.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you had a look at the Math class to see if there might be anything useful in there ?
 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No I have not. Thanks for the direction.

Regards.
 
seema prakash
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
int minRowCount = Math.min(rsRowCount,rs1RowCount);
 
Melinda Savoy
Ranch Hand
Posts: 387
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne -- thanks so much I got it.

Seema - thanks anyway. Your reply is appreciated.

Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic