Bindesh Vijayan

Ranch Hand
+ Follow
since Aug 21, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Bindesh Vijayan

Thanks Val,
Where can I get more information on floating point numbers and their representation in Java?
Yeah! It was my confusion, but sorry pal, still not clear
Thanks
Veena ,I guess by this time you would have got the thread, still:
fina int conversion
[ August 08, 2002: Message edited by: Bindesh Vijayan ]
Hey!!!Congrats to me on becoming RanchHand
[ August 08, 2002: Message edited by: Bindesh Vijayan ]
Madhu this is not the case each time, see my
thread named final int conversion.
Thanks
I tried the following code:

And got an error.What confuses me although I
have used a simple variable to initialize the
final variable, and to me it appears that final
variables are initialized only once to change them into constants then why is the compiler so
indifferent to it when i assign a variable
instead of a int literal at 4.Then i changed the
code into this

And decompiled the class, guess what, i got byte variable being initialised at 4,instead of a constant, iam putting the decompiled version here:


Thanks
Yes I have made similar statement as that of Valentin's with the exception of JLS being transformed to an easy example to make it more easy to understand.
Thanks
Bindesh Vijayan
Yes I have made similar statement as that of Valentins with the exception of JLS being transformed to an easy example to make it more easy to understand.
Thanks
Bindesh Vijayan
Thanks Val
I have some more links
The lean mean virtual machine
Bytecode Basics
Floating Point Arithmetic
Logic and Integer Arithmetic
Bindesh Vijayan
[ July 22, 2002: Message edited by: Bindesh Vijayan ]
Guys,
First things first, Thanks, and a correction I have missed some parts of the code as Rene points out.All I can say is it happens sometimes.
And yes coming back to the problem,I knew this that the array should be given with new
operator,thats not what I wanted to know ,but the specification provided by JLS .
An array initializer is written as a comma-separated list of expressions, enclosed by braces "{" and "}".

I want to be cleared on that...
Thanks
Bindesh
No thats not right
The + operator is used to concatenate 2 values in System.out.println(),no matter what the type is.
as an example:

Thanks..
Bindesh Vijayan
[ July 22, 2002: Message edited by: Bindesh Vijayan ]
Zarina,
I am still using the older one 1.2 .In the
process of downloading newer one ( 1.4 )got errors two times when half of the download was complete. Downloading needs great amount of luck
Thanks
Bindesh Vijayan
The code :

When executed gets the following error:

Array constants can only be used in initializers.
print( {new Object(),new Object(),new Object()},
Array constants can only be used in initializers.
{"A1","A2","A3","A4"}

Am iam not using an initializer.JLS has the following statement

Pls. help..
Thanks
Bindesh Vijayan
Zarina,
I ran the code and got two errors :

so I think it has the logic as Dan points out has
to do with compile time constant.But something
more.Before I proceed lets look what JLS has to say about if statements


We need to understand what is a compile time
constant to the if statement, it is nothing but a
boolean value.Generally, we provide if
with an expression that leads to a boolean
value.Now this expression needs to be evaluated
in order to the statement to be executed.So
here ,when we say if(1==1) we are still
providing an expression to be evaluated at
runtime.So the variable initialization still
epends upon the value of expression,and there is
an ambiguity as to whether j will be intialized
or not and hence the error .But when we say if
(true)
we are directly supplying the required
input for the if statement this is the compile
time constant,And bcoz it is true compiler has
no problem since the statement following will be
executed.Now change the code to the following:

This is also a compile time constant but a false
value which menas the compiler determines at
compile time that this statement will never to be
executed and churns out an error.

Correct me if wrong.
Thanks
Bindesh
[ July 21, 2002: Message edited by: Bindesh Vijayan ]
[ July 21, 2002: Message edited by: Bindesh Vijayan ]
[ July 21, 2002: Message edited by: Bindesh Vijayan ]
When I disassemble a class file I get some assembly language commands(I thinks so ).I remember Jose Botella last year giving some information regarding its interpretation and some links about the topics that could help it.
Can some one at ranch provide me with the link please.
Thanks
Bindesh Vijayan