Ask Experts Questions for FREE Help !
Ask
    antariksh12's Avatar
    antariksh12 Posts: 1, Reputation: 1
    New Member
     
    #1

    Jan 22, 2017, 10:01 PM
    I am performing left shift by 1 operation in java
    byte b=65;
    System.out.println(b<<1);
    O/p is 130.How?
    CravenMorhead's Avatar
    CravenMorhead Posts: 4,532, Reputation: 1065
    Adult Sexuality Expert
     
    #2

    Jan 23, 2017, 08:46 AM
    Write both numbers in binary, if the answer isn't obvious then write down 65 in binary. Add a zero on the right hand side, (The net effect of shifting to the left). Convert resultant number back to decimal. What do you get?

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search


Check out some similar questions!

What all topics comes under advance java?what is framework how it is related to java? [ 0 Answers ]

I want to know about the topics related to advance java?and how the framework likke struts and hibernate realted to each other?what are there uses?

I am new to java GUI and multiple classes, I have knowledge of core java. I have [ 0 Answers ]

Sir, I am new to java GUI and multiple classes, I have knowledge of core java. I have to call a rest client from my net beans project give values to it and receive it's output in the same project. Please suggest me what I need to study and what to do.

Which arithmetical operation is actual operation that computer does internally ? [ 0 Answers ]

I mean that what is the behavior of computer that how can it compute arithmetic operation like Addition (+), Subtraction (?), Multiplication ( or or *), Division ( or /). Yes, It perform all the operation but actually it does all the operation only through addition.This is the only operation...

Java netbeans program- Connection between java and mysql,How to conn [ 0 Answers ]

which I wrote from a book but when I run it, it shows exception please give me the code to connect jlistbox to database when I click on btn1. btn coding should search "name" in database and shows all the names in listbox my coding: here-- r1,r2,r3 are radio btns and l1,l2,l3 are labels,...


View more questions Search