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

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

黄舟
Release: 2017-10-10 10:20:28
Original
1644 people have browsed it

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);
Copy after login


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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template