SCJP Pass 85%....
Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened
Rajeev Trikha (SCJP 6)
SCJP Pass 85%....
Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened
Heba Mahmoud wrote:1-i think there is a difference between ++x and x++... how the value become the same in iteration ??
Heba Mahmoud wrote:2- what about that case of unreachable code ,.. i think that it should the complair fails .. but it doesn't.
Heba Mahmoud wrote:3- when say transient int value =8; after deserialize it becomes 0 as i understand , may be i am wrong
so when it is final , what do you think it will be ?
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
BEE MBA PMP SCJP-6
Ankit Garg said ...
x is not a constant, so the compiler cannot detect its value at compile time so doesn't know that the if condition is true and the println statement is not reachable.
SCJP Pass 85%....
Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened
venkat ga wrote:
Please explain about final transient private int b=10; some internal mechanism.
The variables which are transient which are not serialized. but if i use fianl why serializing is happening?
Heba Mahmoud wrote:
Ankit Garg said ...
x is not a constant, so the compiler cannot detect its value at compile time so doesn't know that the if condition is true and the println statement is not reachable.
i understand from that if we make the boolean x = true ; as a final value then we should have a complair error as x in that case is a constant .... but it complies and runs fine ......
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Make yourself as serene as a flower, as a tree. And on wednesdays, as serene as this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|