Answer to Question #240518 in Java | JSP | JSF for Zia

Question #240518

Kindly answer this urgently.

You can access the question via the link below. Thanks and plz answer.


https://drive.google.com/file/d/1mfyGOKUB_vdWvXTg6R9tHKYe0du0Rnqi/view?usp=sharing

1
Expert's answer
2021-09-22T23:45:15-0400
package longword;
import java.io.*;
import java.util.BitSet;
import java.util.Vector;
public class LongWord {
  private BitSet b;
   LongWord(){
       b=new BitSet(32);
       for(int i=0; i<32; i++){
           b.set(1010);
       }
       
   }
    
    public String toString(){
       long [] longs = b.toLongArray();
        String s = b.toString();
         return s;
        
    }
    
    boolean getBit(int i){
        return b.get(i);
    }
    void setBit(int i){
        b.set(i);
    }
    void toggleBit(int i){
        b.flip(i);
    }
    
    int getSigned(){
        long [] longs = b.toLongArray();
        String s = longs.toString();
        int sign = Integer.parseInt(s);
        return sign;
    }
    long getUnsigned(){
       long [] longs = b.toLongArray();
        String s = longs.toString();
        long sign = Long.parseLong(s);
        return sign;
    }
    
    void copy(LongWord other){
        this.b = other.b;
    }
    LongWord shiftLeftLogical(int amount){
       LongWord other = new LongWord();
       
        other.b = this.b;
      long name = getUnsigned()<<amount;
      return other;
    }
    public static void main(String[] args) {
       LongWord l = new LongWord();
      
    
      
    }
    
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS