Home Answers Viewqa RUP how to calculate max and min

 
 


Asri
how to calculate max and min
2 Answer(s)      4 years and 10 months ago
Posted in : RUP

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 Pages:
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
Using Min, Max and Count on HQL.
Using Min, Max and Count on HQL.  How to use Min, Max and Count on HQL
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
Mysql Min Max
Mysql Min Max       Mysql Min Max is useful to find the minimum and maximum records from a table. Understand with Example The Tutorial illustrate an example from Mysql Min Max
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
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
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
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
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
javascript max size
javascript max size   How to retrive Max size in JavaScript
Hibernate criteria query using Min().
Hibernate criteria query using Min().  How to find minimum value in Hibernate criteria query using Projection?   You can find out minimum...); } } } Output: Hibernate: select min(this_.salary) as y0
Hibernate min() Function
will demonstrate you how to embed the HQL min() function within your code...Hibernate min() Function This section contains an example of the HQL min() function. min() function in HQL returns the smallest value from the selected
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
httpd.conf max connections
httpd.conf max connections  Hi, How to increase the MaxClients value in the apache httpd.conf file? Which is the entry in httpd.conf for max connections? Thanks   Hi, You can add following configuration in httpd.conf
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 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
MySQL Aggregate Function
', 'MIN', 'MAX', and 'SUM') in the MySQL Query. The group (aggregate) functions...; SELECT designation, MIN(salary) , MAX(salary) FROM employee GROUP...;    This example illustrates how use the aggregate 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 many max. arguments we pass to the any function
calculate reward points.
calculate reward points.  How to calculate reward points in a multiplex automation system
How to calculate area of rectangle
How to Calculate Area of Rectangle       In this section we will learn how to calculate area... explain the static method how to display the rectangle values. First of all we have
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 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
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... below will demonstrate you how to embed the HQL max() function within your code
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
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
Calculate factorial of a number.
Calculate factorial of a number.  How to calculate factorial of a given number?   import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Factorial { public static
Calculate sum and Average in java
Calculate sum and Average in java  How to calculate sum and average in java program?   Example:- import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class AvarageTest
No Max-height Fixed
No Max-height Fixed      ... of a Textarea with minimum fixed height but no max height fixed. Steps to develop the Auto generate of a Textarea  with minimum fixed height but no max height fixed
With Fixed Max-Height
; No Min-Height and max-height 100Px <textarea style="width... With Fixed Max-Height      ...; textarea  with fixed Max-Height. Steps to develop the Auto generate
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
calculate difference between two dates
calculate difference between two dates  hi, I was actually working on to calculate the number of days between two dates of dd/mm/yyyy format using javascript. can anyone suggest me how to work it outin calculating
calculate milliseconds to hh mm ss
calculate milliseconds to hh mm ss  how to calculate milliseconds to hh mm ss ? Actually i wanted to calculate week days and hours from milliseconds..?   var seconds = (mil / 1000) | 0; mil -= seconds * 1000; var
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
Week calculate start from friday
Week calculate start from friday  My problem is to calculate how many weeks have a month. Note that my weeks have to start on Friday! I have three combo boxes. First display year. Second one display month. Third one display
calculate difference between two time in jsp
calculate difference between two time in jsp  How to calculate difference between two dates
Calculate Company's Sale using Java
Calculate Company's Sales Using Java In this section, you will learn how to calculate Company's sale. A company sales 3 items at different rates and details of sales ( total amount) of each item are stored on weekly basis i.e. from Monday
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
Calculate factorial Using Recursion
through this example you will be understand how you can calculate the factorial...Calculate factorial Using Recursion  ... to calculate the factorial. The number we have entered in the html page
Calculate the Sum of three Numbers
. In this section you will learn how to calculate the sum of three numbers by using three... how to calculate three integer number . First of all define class name "... Calculate the Sum of Three Numbers   
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
min project with vb - WebSevices
min project with vb  i have do the min project with VB Frantend and oracle backend
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, Try the following code: import java.util.*; public
JavaScript calculate age from date of birth
JavaScript calculate age from date of birth  How to calculate age from date of birth?   <html> <head> <script type="text/javascript"> function ageCount() { var date1 = new Date
Java example to calculate the execution time
will describe you the way that how one can calculate or get the execution time... Java example to calculate the execution time  ... endTime. Now by subtracting the startTime with endTime we can calculate
Calculate total number of elements remaining in the buffer.
Calculate total number of elements remaining in the buffer. In this tutorial, we will discuss how to calculate total number of elements remaining in the buffer.  IntBuffer API: The java.nio.IntBuffer class extends
Javascript calculate number of days between two dates
Javascript calculate number of days between two dates In this tutorial, you will learn how to calculate number of days between two dates.For this, you need to use the Date object  to retrieve the Date's millisecond value
Calculate Age using current date and date of birth
Calculate Age using current date and date of birth In this section you will learn how to calculate the age. For this purpose, through the code, we have prompted the user to enter current date and date of birth in a specified format. Now
Find in Array - Calculate Occurrences of Elements in Array
Find in Array - Calculate Occurrences of Elements in Array       This section illustrates you how to calculate occurrences of elements in an array. Occurrences means, the how many

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.