Home >Java >javaTutorial >Example analysis of finding the larger number between two numbers in Java
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!