Use of Java Compiler
1 posts in topic
Flat View  Flat View

Posted By:   Murugan_K
Posted On:   Tuesday, January 15, 2002 06:43 AM

I have some basic doubts.Pleae clarrify,
1.Java is a strictly typed language. how?
2.what is the purpose of a java compiler?what does it acually do?
3.why there are different compilers for Windows,Unix etc even though all java programs
produce same .class files?

Re: Use of Java Compiler

Posted By:   Simon_Ablett  
Posted On:   Friday, January 18, 2002 06:58 AM

1. Not sure what you mean by 'how?'. It simply checks that an object passed to a method is actually an object of that kind. Unlike in some other languages were an object can pretend to be of a different type.

2. The Java compiler takes source code (the stuff that you enter in the '.java' files) and converts it into an intermediate byte code form. In simple terms it converts the strings of characters that make up the source into a series of tokens. The Java virtual machine (the program in which Java programs actually run) can then process this form of the code far faster than having to re-parse the original source from scratch each time

3. There are different versions of the compilers for different operating systems as these programs (i.e. the compilers) are usually written in a machine dependent form (i.e. they exist as machine code). It is possible to write a Java based Java compiler and I'm sure there's probably some out there if you wished to look hard enough.

Hope that this helps.

About | Sitemap | Contact