Basic question in eclipse....

A

ankur

When I do a class declaration ( without filling it) in eclipse it
creates a .class file automatically without any compilation ? How is
that possible? I mean How does that happen? BTW I feel eclipse
compiles the code by itself...is that correct ? The eclipse IDE throws
compilation errors as the code is typed.

If I use command line option using javac then class file is not
generated if the code as syntax error whereas in eclipse .class file
is generated as soon as the class is declared and even though later on
as the class is filled the code might have syntax error!

Thanks,
Ankur
 
A

Arne Vajhøj

ankur said:
When I do a class declaration ( without filling it) in eclipse it
creates a .class file automatically without any compilation ? How is
that possible? I mean How does that happen? BTW I feel eclipse
compiles the code by itself...is that correct ?


Eclipse builds every time you save.
> The eclipse IDE throws
> compilation errors as the code is typed.

And it also parse what you type.
If I use command line option using javac then class file is not
generated if the code as syntax error whereas in eclipse .class file
is generated as soon as the class is declared and even though later on
as the class is filled the code might have syntax error!

As soon the class is created it is a valid Java source. That valid
Java source is compiled to a class file.

If you then type something syntactically wrong, then it does not
compile anymore, but then the existing class file are just not
overwritten and are still there.

Arne
 

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,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top