This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How to determine min of two int values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to determine min of two int values" Watch "How to determine min of two int values" New topic
Author

How to determine min of two int values

Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 386

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

Joined: Aug 05, 2005
Posts: 3419
    
  12
Have you had a look at the Math class to see if there might be anything useful in there ?


Joanne
Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 386

No I have not. Thanks for the direction.

Regards.
seema prakash
Ranch Hand

Joined: Nov 17, 2004
Posts: 59
int minRowCount = Math.min(rsRowCount,rs1RowCount);
Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 386

Joanne -- thanks so much I got it.

Seema - thanks anyway. Your reply is appreciated.

Regards.
 
wood burning stoves
 
subject: How to determine min of two int values
 
Similar Threads
getRGB method
Question from danchisholm
fields of visibility
Programmatically set the knob position of a JScrollBar
help with parameter passing