Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

# Tejas Kansara

Ranch Hand
since Dec 14, 2000
Cows and Likes
Cows
0
In last 30 days
0
Total given
0
Likes
0
0
Total given
0
Given in last 30 days
0
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

## Recent posts by Tejas Kansara

Peter could you please explain the following :
int i =-31;
How will you convert the -31 to binary and back again to decimal.
Please do me a favor. I am just CONFUSED with negative values.
One more interesting topic
double a,b;
Thanx.....
a = 2.0;
b = 0.0;
double c = a/b;
Now when I do the following why it gives different results.
int x = (int) c;
and
byte y = (byte) c;
20 years ago
Peter thanks for all your co-operation and help
actually I have been working on bitwise topic since
few days. Actually to some extent I am clear with few
operators but when it comes to negative values, I get confused.
Also explain how to judge a negative value when it is written in binary form.
My main problem is with NEGATIVE VALUES AND SHIFTS. Mainly negative shifts.
Guide me pleazzzzz.
Just see to the following program and explain the output b'coz it gives a vast difference
when it is 5 and -5
class RightShift
{
public static void main(String[] args)
{
int i =-5;
//int i = 5;
i >>= 1;

System.out.println(i);
}
}
20 years ago
Thanx Peter but still doubts :
---------------------------------------------------------------
0101 >> 1 = 0010 = 2 = 5/2
0010 << 1 = 0100 = 4 = 2*2<br /> What does 5/2 and 2*2 suggests ??? - Explain pleazeee ...<br /> A N D..... the one below : <br /> 1011 >> 1 = 1101 = -3 = (-5)/2 (always rounding down, and a "1" is shifted into the left to preserve sign)
1011 >>>1 = 0101 = 5 (the unsigned bitshift operator always shifts in "0" and does not preserve sign)
0101 << 1 = 1010 = -6 (the left shift operator overflows in this case - there is no signed 4-bit representation of 5*2=10)<br /> I AM CONFUSED WITH THE NEGATIVE SHIFTS <br /> i.e <br /> 1011 >> 1 is how come -3 ....
1011 >>> 1 is how come 5 ....
DO ME A FAVOR AND CLEAR MY DOUBTS
THANX AGAIN.
20 years ago
Could anyone please explain me the following :
How come the output of ~3 is -4
Could you give me a brief explaination regarding the same.
And few hints related to Left/Right Shift,etc
I am preparing for SCJP and in ref. books I am not having enough of explaination.
Thanking you in ANTICIPATION.
Regards
Tejas
20 years ago
Hello friends
I am working on JSP and I am using JAVAWEBSERVER2.0
Kindly guide me where to store (BEAN) .class files and where to store our JSP files b'coz when I am storing .jsp files in c:\javawebserver2.0\examples\jsp folder and the (Bean) .class file in c:\javawebserver2.0\classes folder along with the package I am getting an error "object or class not found ...."
Could anyone guide me as soon as possible.
Regards
Tejas
21 years ago
Hello Friends,
Just to know whether C# is going to replace Java.
Or is it only hype ???
Well, anyone can pour some light.
Regards
Tejas
21 years ago
Could anyone please explain me regarding scope of variables and object in a jsp file.
I am getting confused.
Regards
Tejas
21 years ago
I apologise for the prev. answer.
Actually, I went thru the question again and corrected the answer and it is break middle or continue outer
Hope I am right this time.
Regards
Tejas
21 years ago
Well, I apologise for my previous ans.
I wasn't clear with the question before but quite clear now.
The ans is
continue outer;
or
break middle
-Tejas
21 years ago
Dear All
Undoubtly break outer is used.
Just check it out.
Regards
Tejas
21 years ago
Hey !!! What's the problem anyways ...
It is working fine.
Cheers
Tejas Kansara.
21 years ago
According to me it is 'a'
bcoz you cannot type cast one derived to other derived instead you can cast from derived to base class.
Cheers
Tejas Kansara
21 years ago
Hello friends,
Well, I am fresh with JSP. I would like to know where to store .jsp files, .class(bean files), etc if I am using JavaWebServer2.0
Can anyone make it clear for me.
Regards
Tejas
21 years ago
Well, friends got the idea but just wanted to know that whether there is any utility in java itself using which we can create executable files.
Write back soon.
Regards
Tejas
21 years ago
Hello all,
Well my query is that can we create an exe file in Java. If yes how ???
Can any one pour some light.
Regards
Tejas
21 years ago