Here you can find the source of setBits(int value, int bits)
Parameter | Description |
---|---|
value | value |
bit | bit or bit set to set in the value |
value
with set selected bits
public static int setBits(int value, int bits)
//package com.java2s; /**//from w w w. j a v a 2 s .c om * @licence GNU Leser General Public License * * $Id$ * $HeadURL$ */ public class Main { /** * Set selected bit(s) in giving value * * @param value value * @param bit bit or bit set to set in the value * @return <code>value</code> with set selected bits */ public static int setBits(int value, int bits) { return value | bits; } }