tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Google Guava > Primitives > Booleans Concat

Booleans Concat 

Google Guava is a java library with lot of utilities and reusable components. This requires the library guava-10.0.jar to be in classpath. The following example shows using Booleans.concat() API. It returns a boolean array by concatenating the given boolean arrays.

File Name  :  
com/bethecoder/tutorials/guava/primitive_tests/BooleanConcatTest.java 
Author  :  Sudhakar KV
Email  :  [email protected]
   
package com.bethecoder.tutorials.guava.primitive_tests;

import java.util.Arrays;

import com.google.common.primitives.Booleans;

public class BooleanConcatTest {

  /**
   @param args
   */
  public static void main(String[] args) {
    boolean [] one = false, false };
    boolean [] two = {  };
    boolean [] three = true, true, true };
    
    boolean [] four = Booleans.concat(one, two, three);
    System.out.println(Arrays.toString(four));
  }

}
   

It gives the following output,
[false, false, true, true, true]



 
  


  
bl  br