Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

how to take binary input in java

String input="1001010101010101";
int len=input.length();
BitSet bs=new BitSet(len);
int i=len-1;
for (char c:input.toCharArray()) 
	bs.set(i--, c=='1'?true:false);
Comment

PREVIOUS NEXT
Code Example
Java :: User input (scanner) 
Java :: java record 
Java :: how to skip a line with a filewriter java 
Java :: resttemplate get rest api call in java 
Java :: find first and last position of element in sorted array 
Java :: MD5 java 
Java :: java 14 switch 
Java :: Java @Deprecated annotation 
Java :: java boolean data type 
Java :: java how to split a string to array 
Java :: convert from integer to character java 
Java :: java data structure 
Java :: terminate function calling in java 
Java :: Passing data from an activity to a fragment 
Java :: static block in java 
Java :: menu alert dialog in android 
Java :: insert node at end of doubly linked list 
Java :: try catch block 
Java :: java application 
Java :: java unicode characters 
Java :: java check if array element is null 
Java :: Is the main method compulsory in Java? 
Java :: Java public no-arg constructor 
Java :: factorial recursion java 
Java :: map indexof java 
Java :: add new item to array java 
Java :: java mcq test 
Java :: java test coverage 
Java :: transform primitive float array to float array 
Java :: netbeans how to get string from jcombobox 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =