Java Virtual Machine
All language compiler translate source code into machine code for a specific computer .Java compiler also does the same thing ,Then how does java archive architecture neutrality ? The answer is that the java compiler produces an intermedia code known an bytecode for a machine that does not exits , This is a machine is called the java virtual machine and it exits only inside the computer memory , It is a simulated computer within the computer and does all major machine of a real computer, illustrates the process of compiling a java program into byte code which is also referred to as virtual machine code
The virtual ma chine code is not machine specific code (known as machine code) is generated by the code interpreter by acting as an intermediary between the virtual machine and the real machine as shown in Remember that the interpreter is different for different machines.
Bytecode Java Machine Virtual Machine Interpreter Code Real Machine
Illustrate hoe java work on a typical computer , The java object framework (Java API) acts as the intermediate between the user the virtual machine which in turn acts the intermediary between the operating system and the java object framework
.Command Line Arguments
There may be occasions when we may like our program to acts in a particular way depending on the input provided at the time of in the executions . This is archived in java program by using what are the known as command line argument , command line argument are para meter that are supplied to the application program at the time of invoking it of execution , It may be recalled that program was for invoked execution of the command line
.Here, we have not supplied any command line argument. Even if we supply argument, the program does not know what to do with them.
We can write Java programs that can receive and use the argument provided in the command line. Recall the signature of the main ( ) method used in our earlier example programs:
As pointed out earlier, is declared as any array of string known as string objects .Any argument provided in the command line at the time of execution are passed to the array its elements , We can simply access the array element and use them in the program as we wish .
Comments
Post a Comment