javac question

J

Jacinle Young

Hi,

when I use

A) javac A.java B.java

and

B) javac A.java
javac B.java

I found that the class file size are the same
but when I use cmp, it is different, so ....

any explanation?

should we use method A), as it seems to compile faster on UNIX

Jacinle
 
A

Anthony Borla

Jacinle Young said:
Hi,

when I use

A) javac A.java B.java

and

B) javac A.java
javac B.java

I found that the class file size are the same
but when I use cmp, it is different, so ....

any explanation?

Either different timestamps [after all, one file is compiled a significant
period (seconds) after the other], or different values in the bytecode
generated as a result of each separate invocation.

See the thread entitled:

Re: Same .java different .class after 2 compilations !!

from November 28, for some interesting views on this.
should we use method A), as it seems to compile
faster on UNIX

Sure, because the 'javac' binary executable is only loaded *once* and
compiles two files ! In general, this is more efficient, hence preferable.

I hope this helps.

Anthony Borla
 
J

Jacinle Young

Anthony,

Thank you.
I am using IBM DJK1.2.2, same with the guy on 28 November

Jacinle

Anthony Borla said:
Jacinle Young said:
Hi,

when I use

A) javac A.java B.java

and

B) javac A.java
javac B.java

I found that the class file size are the same
but when I use cmp, it is different, so ....

any explanation?

Either different timestamps [after all, one file is compiled a significant
period (seconds) after the other], or different values in the bytecode
generated as a result of each separate invocation.

See the thread entitled:

Re: Same .java different .class after 2 compilations !!

from November 28, for some interesting views on this.
should we use method A), as it seems to compile
faster on UNIX

Sure, because the 'javac' binary executable is only loaded *once* and
compiles two files ! In general, this is more efficient, hence preferable.

I hope this helps.

Anthony Borla
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top