黄色网址大全免费-黄色网址你懂得-黄色网址你懂的-黄色网址有那些-免费超爽视频-免费大片黄国产在线观看

Guava教程

Guava Ints類

整數(shù)Ints是原始的int類型的實用工具類。

類聲明

以下是com.google.common.primitives.Ints類的聲明:

@GwtCompatible
public final class Ints
? ?extends Object

字段

方法

繼承的方法

這個類繼承了以下類方法:java.lang.Object

Ints 示例

使用所選擇的任何編輯器創(chuàng)建下面的java程序 C:/> Guava

GuavaTester.java

import java.util.List;

import com.google.common.primitives.Ints;

public class GuavaTester {

   public static void main(String args[]){
      GuavaTester tester = new GuavaTester();
      tester.testInts();
   }

   private void testInts(){
      int[] intArray = {1,2,3,4,5,6,7,8,9};

      //convert array of primitives to array of objects
      List<Integer> objectArray = Ints.asList(intArray);
      System.out.println(objectArray.toString());

      //convert array of objects to array of primitives
      intArray = Ints.toArray(objectArray);
      System.out.print("[ ");
      for(int i = 0; i< intArray.length ; i++){
         System.out.print(intArray[i] + " ");
      }
      System.out.println("]");
      //check if element is present in the list of primitives or not
      System.out.println("5 is in list? "+ Ints.contains(intArray, 5));

      //Returns the minimum		
      System.out.println("Min: " + Ints.min(intArray));

      //Returns the maximum		
      System.out.println("Max: " + Ints.max(intArray));

      //get the byte array from an integer
      byte[] byteArray = Ints.toByteArray(20000);
      for(int i = 0; i< byteArray.length ; i++){
         System.out.print(byteArray[i] + " ");
      }
   }
}

驗證結(jié)果

使用javac編譯器編譯如下類

C:\Guava>javac GuavaTester.java

現(xiàn)在運行GuavaTester看到的結(jié)果

C:\Guava>java GuavaTester

看到結(jié)果

[1, 2, 3, 4, 5, 6, 7, 8, 9]
[ 1 2 3 4 5 6 7 8 9 ]
5 is in list? true
Min: 1
Max: 9
0 0 78 32?

 

 

 

 

轉(zhuǎn)載自并發(fā)編程網(wǎng)-ifeve.com

全部教程
主站蜘蛛池模板: 国产精品天天在线 | 中文字幕在线看片成人 | 一级片一区 | 在线亚洲精品自拍 | 久久久精品成人免费看 | 国产精品欧美一区二区三区不卡 | 小 视频 黄 | 精品一区二区三区影院在线午夜 | 亚洲一区二区三区久久久久 | 久久99国产精品久久 | 天天躁夜夜躁狠狠躁2018a | 最近中文字幕无免费视频 | 亚州精品视频 | 亚洲视频观看 | 欧美一级特黄一片免费 | 亚洲码和乱人伦中文一区 | 天天摸夜夜摸成人免费视频 | 羞羞视频网址 | 国产日本久久久久久久久婷婷 | 黄色网址网站在线观看 | 操一操日一日 | 亚洲图欧美 | 五月天婷婷一区二区三区久久 | 亚洲 欧美 另类中文字幕 | 美国videos 18高清hd | 在线中文字幕网 | 日本精品视频一区 | 美女黄网站全是免费网址 | 成人欧美s视频在线观看 | 成人特黄午夜性a一级毛片 成人网18免费软件 成人网免费 | 欧美黑人性猛交╳xx╳动态图 | 日韩免费一区二区 | 欧美激情xxxx | 成人黄色免费观看 | 精品国产v无码大片在线观看 | 一区二区高清视频在线观看 | 人人插人人舔 | 亚洲欧洲日韩综合色天使不卡 | 午夜小视频免费观看 | 成人免费片 | 日韩video|