Wednesday, 28 August 2013

how does java code compile

how does java code compile

I'm just asking if different ways of writing a code is compiled
differently or the same.
So if i have something like this: ("object" being the class name)
object o = class.getMethod();
if(o != null){
if(o.get() != null){
//do whatever....
}
}
Would it be the same as this?
if(class.getMethod().get() != null){
//do whatever...
}
When code is compiled like would they both be exactly written the same in
bytecode. I heard that while(true) and while(1==1) would be the same in
bytecode as they are going to be while(true).

No comments:

Post a Comment