Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/careercup/ctci
/ getBit
Method
getBit
java/Chapter 5/Sample_Code/Sample_Code.java:7–9 ·
view source on GitHub ↗
(int num, int i)
Source
from the content-addressed store, hash-verified
5
public
class
Sample_Code {
6
7
public
static
boolean getBit(
int
num,
int
i) {
8
return
((num & (1 << i)) != 0);
9
}
10
11
public
static
int
setBit(
int
num,
int
i) {
12
return
num | (1 << i);
Callers
1
main
Method · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected