日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > java >内容正文

java

math.pow int_Java Math类static int min(int i1,int i2)与示例

發(fā)布時(shí)間:2025/3/11 java 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 math.pow int_Java Math类static int min(int i1,int i2)与示例 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

math.pow int

數(shù)學(xué)類靜態(tài)int min(int i1,int i2) (Math Class static int min(int i1 , int i2) )

  • This method is available in java.lang package.

    此方法在java.lang包中可用。

  • This method is used to return the minimum one of both the given arguments or in other words this method returns the smallest value of the given two arguments.

    此方法用于返回給定兩個(gè)參數(shù)中的最小值。換句話說,此方法返回給定兩個(gè)參數(shù)中的最小值。

  • This is a static method so this method is accessible with the class name too.

    這是一個(gè)靜態(tài)方法,因此也可以使用類名訪問此方法。

  • The return type of this method is int, it returns the smallest element from the given two arguments.

    此方法的返回類型為int ,它從給定的兩個(gè)參數(shù)中返回最小的元素。

  • This method accepts two arguments of integer (int) types.

    此方法接受兩個(gè)整數(shù)( int )類型的參數(shù)。

  • This method does not throw any exception.

    此方法不會引發(fā)任何異常。

Syntax:

句法:

public static int min(int i1, int i2){}

Parameter(s): int i1, int i2 – two integer values, in which we have to find the smallest/minimum value.

參數(shù): int i1,int i2 –兩個(gè)整數(shù)值,我們必須在其中找到最小/最小值。

Return value:

返回值:

The return type of this method is int, it returns the smallest/minimum value.

此方法的返回類型為int ,它返回最小/最小值。

Note:

注意:

  • If we pass "NaN" (Not a Number), it returns the same value i.e. "NaN".

    如果我們傳遞“ NaN”(不是數(shù)字),它將返回相同的值,即“ NaN”。

  • If we pass zero (-0 or 0), it returns the 0.

    如果傳遞零(-0或0),則返回0。

  • If we pass the same values in both parameters, it returns the same value.

    如果我們在兩個(gè)參數(shù)中傳遞相同的值,則它將返回相同的值。

Java程序演示min(int i1,int i2)方法的示例 (Java program to demonstrate example of min(int i1,int i2) method)

// Java program to demonstrate the example of // min(int i1, int i2) methodpublic class MinDoubleTypeMethod {public static void main(String[] args) {// declaring variablesint i1 = -0;int i2 = 0;int i3 = -2;int i4 = 124;// displaying the valuesSystem.out.println("i1: " + i1);System.out.println("i2: " + i2);System.out.println("i3: " + i3);System.out.println("i4: " + i4);// Here , we will get (-2) because we are passing // parameter whose value is (-0,0)System.out.println("Math. min(i1,i3): " + Math.min(i1, i3));// Here , we will get (0) because we are passing // parameter whose value is (-0,0)System.out.println("Math.min(i1,i2): " + Math.min(i1, i2));// Here , we will get (0) and we are passing // parameter whose value is (0,124)System.out.println("Math.min(i2,i4): " + Math.min(i2, i4));} }

Output

輸出量

E:\Programs>javac MinDoubleTypeMethod.javaE:\Programs>java MinDoubleTypeMethod i1: 0 i2: 0 i3: -2 i4: 124 Math. min(i1,i3): -2 Math.min(i1,i2): 0 Math.min(i2,i4): 0

翻譯自: https://www.includehelp.com/java/math-class-static-int-min-int-i1-int-i2-with-example.aspx

math.pow int

總結(jié)

以上是生活随笔為你收集整理的math.pow int_Java Math类static int min(int i1,int i2)与示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。