and it would work just fine. Previous declaration of int i would not be seen as a duplicate as they are in separate blocks of code, thus their scope is limited to their blocks. The repitition of
u
in main is not allowed however.
sekhar subbu
Greenhorn
Joined: Nov 21, 2006
Posts: 7
posted
0
Originally posted by Murad Iqbal: It will not compile. Try changing
in main is not allowed however.
Hi thanks a lot for the explanation....actually i saw it in a javatest question paper and i was wondering abt the answer?
anyways now i got the answer .
But i wanted to know why does in main ....we cant have that redeclaration like in class ?
Murad Iqbal
Ranch Hand
Joined: Dec 09, 2003
Posts: 90
posted
0
Its not about main. Its about method. You can not have that redeclared in a method. In a class you can.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.