Home  >  Article  >  Java  >  Example analysis of finding the larger number between two numbers in Java

Example analysis of finding the larger number between two numbers in Java

黄舟
黄舟Original
2017-10-10 10:20:281615browse

The following editor will bring you an article to find the larger number of two numbers in java (explanation with examples). The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor and take a look.

The max function in Java is applied in Math

as follows:

int a=34;
int b=45;
int ans=Math.max(34,45);


Then the value of ans is 45.

The above is the detailed content of Example analysis of finding the larger number between two numbers in Java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn