Class 5
Class 5
============================
Diagram: class5.1
Now JVM will invoke one module called classloader or sub system to load all the
byte code instructions from .class file.The work of classloader is to check these
byte code instructions are proper or not.
If they are not proper then it will refuse the execution. If they are proper then
it will allocates the memories.
1) Method Area
------------
It contains code of a class, code of a variable and code of a method.
2) Heap
--------
Our object creations will store in heap area.
3) Java Stack
--------------
Java methods will store in method area.
To execute those methods we required some memory and that memory will be allocated
in java stack.
4) PC Register
--------------
It is a program counter register which is used to track the address of an
instructions.
Execution Engine
----------------
Execution engine contains interpreter and JIT compiler.
Whenever JVM loads byte code instructions from .class file , it will uses
interpreter and JIT compiler.
A method which is developed by using some other language is called native method.
1) Method Area
2) Heap
3) Java Stack
4) PC Register
It is a part of a JVM which is used to increase the execution speed of our program.
1) Bootstrap classloader
2) Extension classloader
3) Application/System classloader
Identifiers
===========
A name in java is called identifier.
ex:
class Test
{
public static void main(String[] args)
{
int x = 10;
System.out.println(x);
}
}
Rule2:
------
If we take other characters then we will get compile time error.
ex:
int emp$al;
String stud_Name;
double emp#Fee; //invalid
Rule3:
------
Identifier must and should starts with alphabet, underscore or dollar symbol
but not
with digits.
ex:
int _empId; //valid
int $alary;//valid
int a1234; //valid
int 1abcd; //invalid
Rule4:
------
Every identifier is a case sensitive.
ex:
int number;
int NUMBER;
int NuMbEr;
Rule5:
-----
We can't take reserved words as an identifier name.
ex:
int if; //invalid
int else; //invalid
Rule6:
-----
There is no length limit for an identifier but it is not recommanded to take
more then
15 characters.