how to calculate max and min

how to calculate max and min

View Answers

August 11, 2008 at 10:42 AM

Hi friend,

In Math class having two function max and min in java.

public class MathMaxMin {
public static void main(String args[]) {

// Method for the max number among the pair of numbers
System.out.println("Method results");
System.out.println("Math.max(5,8) " + Math.max(5,8));

byte bt = 8;
double dt = 10.0;
//Method for the max value between the values of bt
// dt variables
System.out.println("Math.max(bt, dt) "+Math.max(bt, dt));

// Method for the min number among the pair of number
System.out.println("Method results");
System.out.println("Math.min(5,8) " + Math.min(5,8));

byte btm = 7;
double dtm = 10.0;
//Method for the max value between the values of btm
// dtm variables
System.out.println("Math.min(btm, dtm) " +Math.min(btm, dtm));

}
}

For read more information to visit the link........

http://www.roseindia.net/java/beginners/MathClass.shtml

Thanks

August 11, 2008 at 10:46 AM

Hi friend,

In Math class having two function max and min in java.

public class MathMaxMin {
public static void main(String args[]) {

// Method for the maximum number among the pair of numbers
System.out.println("Method results");
System.out.println("Math.max(5,8) " + Math.max(5,8));

byte bt = 8;
double dt = 10.0;
//Method for the max value between the values of bt
// dt variables
System.out.println("Math.max(bt, dt) "+Math.max(bt, dt));

// Method for the minimum number among the pair of number
System.out.println("Method results");
System.out.println("Math.min(5,8) " + Math.min(5,8));

byte btm = 7;
double dtm = 10.0;
//Method for the minimum value between the values of btm
// dtm variables
System.out.println("Math.min(btm, dtm) " +Math.min(btm, dtm));

}
}

For read more information to visit the link........

http://www.roseindia.net/java/beginners/MathClass.shtml

Thanks









Related Tutorials/Questions & Answers:
how to calculate max and min - RUP
how to calculate max and min  hye!i'm a new for the java and i want to ask a question . Could anyone help me to teach how to calculate the maximum... function max and min in java. public class MathMaxMin { public static
how to calculate max and min in the loop - Java Beginners
how to calculate max and min in the loop  thanks coz giving me... main(String a[]) throws IOException { int max,min; max=Integer.parseInt(a[0]); min=Integer.parseInt(a[0]); for(int i=0;imax) max=Integer.parseInt
Advertisements
Using Min, Max and Count on HQL.
Using Min, Max and Count on HQL.  How to use Min, Max and Count on HQL
ModuleNotFoundError: No module named 'min-max'
-max' How to remove the ModuleNotFoundError: No module named 'min-max...ModuleNotFoundError: No module named 'min-max'  Hi, My Python... to install padas library. You can install min-max python with following command
ModuleNotFoundError: No module named 'min-max'
-max' How to remove the ModuleNotFoundError: No module named 'min-max...ModuleNotFoundError: No module named 'min-max'  Hi, My Python... to install padas library. You can install min-max python with following command
How to calculate minimum in Hibernate using the min() Function
How to calculate minimum in Hibernate using the min() Function The min... will teach you how to use the HQL min() function in your Hibernate based.... In this tutorial we will use the min() function in Hibernate and run
Mysql Min Max
Mysql Min Max       Mysql Min Max is useful to find the minimum and maximum records from a table... Mysql Min Max. To understand and grasp the example we create a table 'employee
Example of Average, Sum, Min and Max functions in MySQL
Example of Average, Sum, Min and Max functions in MySQL  Hi, How to use the aggregate functions like Average, Sum, Min and Max in MySQL? Thanks... in set (0.00 sec) mysql> select max(email_count) from email
hibernate criteria Max Min Average Result Example
hibernate criteria Max Min Average Result Example In this Example, We... the Projections class max, min ,avg methods. Here is the simple Example code files...("Max Salary is : "); System.out.print(row[i]); System.out.printf("\n
How to install cocoapods in Max?
How to install cocoapods in Max?  How to install cocoapods on MacOSx? Tell me the easiest method. Thanks   Hi, Use following command: sudo gem install cocoapods Thanks   Hi, Here is the video instruction
Max()
Max()  How to find maximum values A101,A107,A108 from a table in sql
Max()
Max()  How to find maximum values A101,A107,A108 from a table in sql
How to get max date in Hibernate?
How to get max date in Hibernate?  Hi, Tell the code to get the max... in Hibernate for getting the max date. Here is example code: Projections.max("addmision_date") Check the complete source code at Hibernate Criteria Max Date Example
How to calculate attending hours?
How to calculate attending hours?  I need to calculate attending hours of a employee in a day in my project to make their monthly salary . By using work starting time and ending time. How should I do it using Date class? Or any
How to calculate days in a year
How to calculate days in a year  Hi, How to calculate no of days in a year? I want a program that calculates no of days in a year by specifying year a parameter. Thanks   Hi, Please check the thread example
How to calculate the average in Hibernate?
How to calculate the average in Hibernate?  Hi, I have to calculate the average in Hibernate. How to calculate the average in Hibernate? Thanks   Hi, You can use the project in Hibernate. Here is the example code
Find max and min value from Arraylist
Find max and min value from Arraylist In this tutorial, you will learn how... max() and min() respectively. Here is an example that consists of ArrayList of integers and using the max and min methods of Collections class, we have find
how to calculate the price on the option box
how to calculate the price on the option box  How i calculate the value when i using a option box with 2 option..first option i used for product name... to calculate this value
how to calculate EMI of the loan
how to calculate EMI of the loan   package carloanapp; import java.io.FileWriter; import java.io.IOException; public class CarLoan { Customer gObjCustomer = null; double gDbRequestedLoanAmount = 0; double
How to calculate average of array in Java?
How to calculate average of array in Java?  Hi, I have an integer array and I want to calculate the average of the values in it. How to calculate... the elements of array and then calculate sum. Then divide it with the length
how many max. arguments we pass to the any function ? how many max. arguments we pass to the any function ?
how many max. arguments we pass to the any function ? how many max. arguments we pass to the any function ?   how many max. arguments we pass to the any function
How to calculate area of rectangle
How to Calculate Area of Rectangle       In this section we will learn how to calculate area... In this program explain the static method how to display the rectangle values. First
How to calculate Date Difference in Java?
How to calculate Date Difference in Java?  Hi, I have two dates variable. How to calculate Date Difference in Java? Thanks   Hi, You can use the Calendar class for calculating the date difference in Java. Get data
how to calculate the employee tax - JSP-Servlet
how to calculate the employee tax  How to calculate the employee tax.Can u please send to me calculation tables
How to calculate sum of HH:MM:SS Format?
How to calculate sum of HH:MM:SS Format?  how to calculate sum of HH:MM:SS? for example: 10:25:36+26:50:56 calculate sum of these values
how many max. arguments we pass to the any function ?
how many max. arguments we pass to the any function ?   how many max. arguments we pass to the any function
Min Value
Min Value   How to access min value of column from database table... min(id) from QuestionModel result_info"; Query query = session.createQuery(selectQuery); System.out.println("Min Value : " +query.list().get(0
How to calculate number of weeks in a specified month
How to calculate number of weeks in a specified month  I am create one program that contain three combo box. 1.cmbyear 2.cmbmonth 3.cmbweek i am select year and month. then automatically calculate number of weeks in a specified
How to calculate area of triangle
.style1 { margin-right: 0px; } How to Calculate...; In this section we will learn how to calculate area of triangle. We... in this program we will fine the how to the display massage the area
javascript max size
javascript max size   How to retrive Max size in JavaScript
ModuleNotFoundError: No module named 'min'
ModuleNotFoundError: No module named 'min'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'min' How to remove the ModuleNotFoundError: No module named 'min' error
how to calculate salary of all the employees 10%extra then actual salary - SQL
how to calculate salary of all the employees 10%extra then actual salary  how to calculate salary of all the employees 10% extra then actual salary  Hi Friend, We are providing you a code that will calculate
Hibernate Min() Function (Aggregate Functions)
(...), min(...), max(...) , count(*), count(...), count(distinct ...), count(all... Hibernate Min() Function (Aggregate Functions)       In this section, we will show you, how to use
how can i calculate loan - Java Interview Questions
how can i calculate loan  negotiating a consumer loan is not always.... the program should then calculate the face value required in order for the consumer to receive the amount needed. it should also calculate the monthly payment
ModuleNotFoundError: No module named 'max'
ModuleNotFoundError: No module named 'max'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'max' How to remove the ModuleNotFoundError: No module named 'max' error
JDBC Select Max Example
JDBC Select Max Example In this tutorial we will learn how use  MAX... values   that  pass in Max function  i.e  "SELECT MAX... query "SELECT MAX(user_id) FROM user"  fetch the  maximum
how can you calculate you your age in daies??
how can you calculate you your age in daies??  **hi, I am beginner in java! can any one help me to write programm to calculate age in daies???**   Hi Friend,ADS_TO_REPLACE_1 Try the following code: import
Hibernate Max() Function (Aggregate Functions)
(...), sum(...), min(...), max(...) , count(*), count(...), count(distinct... Hibernate Max() Function (Aggregate Functions)       In this section, we will show you, how
ModuleNotFoundError: No module named 'mroylib-min'
'mroylib-min' How to remove the ModuleNotFoundError: No module named 'mroylib-min' error? Thanks   Hi, In your python environment...ModuleNotFoundError: No module named 'mroylib-min'  Hi, My Python
ModuleNotFoundError: No module named 'bat_min'
_min' How to remove the ModuleNotFoundError: No module named 'bat_min...ModuleNotFoundError: No module named 'bat_min'  Hi, My Python... to install padas library. You can install bat_min python with following command
ModuleNotFoundError: No module named 'find-min'
'find-min' How to remove the ModuleNotFoundError: No module named 'find-min...ModuleNotFoundError: No module named 'find-min'  Hi, My Python... to install padas library. You can install find-min python with following
min project with vb - WebSevices
min project with vb  i have do the min project with VB Frantend and oracle backend
how to calculate addition of two distances in feets and inches using objects as functions arguments
how to calculate addition of two distances in feets and inches using objects as functions arguments  how to calculate addition of two distances in feets and inches using objects as functions arguments in java
JPA Max Function
JPA Max Function       In this section, you will learn how to develop a jpa max function. JPA max function retrieves data from the database table field which
Hibernate max() Function
Hibernate max() Function In this tutorial you will learn about how to use HQL max() function. max() function in HQL returns the largest value from... is being given below will demonstrate you how to embed the HQL max() function
calculate reward points.
calculate reward points.  How to calculate reward points in a multiplex automation system
ModuleNotFoundError: No module named 'calculate'
'calculate' How to remove the ModuleNotFoundError: No module named 'calculate' error? Thanks   Hi, In your python environment you...ModuleNotFoundError: No module named 'calculate'  Hi, My Python
ModuleNotFoundError: No module named 'max-ent'
ModuleNotFoundError: No module named 'max-ent'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'max-ent' How to remove the ModuleNotFoundError: No module named 'max-ent
ModuleNotFoundError: No module named 'max-span'
ModuleNotFoundError: No module named 'max-span'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'max-span' How to remove the ModuleNotFoundError: No module named 'max-span
ModuleNotFoundError: No module named 'my_max'
_max' How to remove the ModuleNotFoundError: No module named 'my_max'...ModuleNotFoundError: No module named 'my_max'  Hi, My Python... to install padas library. You can install my_max python with following command

Ads