Before we began to write serious programs in JAVA, it would be interesting to find out what really is java.
Java is a language which makes use of a principle called Object Oriented Programming(OOP) to organise the program. In OOP there are things like classes, objects, inheritance, polymorphism, templates, exception handling, references, etc. We will learn these concepts later.
Architecture of JAVA:
Unlike C,C++, java is a platform independent language which means it doesn’t need different
compiler to run on different machine. Same compiler works for different architecture.
A source code is generated. Compiler takes the source code and generates .exe file which can be executed at any time.
Its advantage is in reducing development for compiler and the disadvantage is that we have to convert byte code, so takes more time.
(BYTE CODE : a code which is not specified according to architecture)
Now an important question arises – why are compiler and interpreter both used to run a java code?
The answer to this question is that the compiler is used to convert source code to byte code. Now to make the byte code work on different machines we need different interpreter. That’s why both compiler and interpreter are used to run a java code.
By Rabbit
0 comments:
Post a Comment