Seven, system work procedures and operations
Eight, instance program operation results
Example
Code
Class
MAIN {
Public static void main (String [] args) {
System.out.println (10);
}
}
Class g {
Class g {
Public int GET (int Num) {
Int a;
A = 2;
Return A 5;
}
}
Class H Extends g {
Class H Extends g {
INT I;
Boolean BOL;
Public int Put () {
Public int Put () {
i = 1 2;
I = 12-3;
I = 2 * 7;
Bol = True && False;
Bol = True && False;
BOL = 1 <2;
Return 10;
Return 10;
}
}
Inheritance tree
Inheritance tree
Symbol table
Symbol table
Memory allocation table
Example 2
Code
Class fact {
Public static void main (string [] a) {
System.out.println (New Fac (). Computefac (10));
}
}
Class Fac Extends Factorial {
Class Fac Extends Factorial {
FAC F;
Factorial ff;
INT I;
Public int computefac (int Num) {
Public int computefac (int Num) {
INT Numaux;
IF (Num <1)
Numaux = 1;
Else
Numaux = Num * (this.Computefac (NUM-1));
Return Numaux;
}
}
Class f extends FAC {
Class f extends FAC {
}
Class g extends factorial {
Class g extends factorial {
}
Class h {}
Class h {}
Class I extends h {}
Class I extends h {}
Class J Extends I {}
Class J Extends I {}
Class GG Extends I {}
Class GG Extends I {}
Class DD Extends I {}
Class DD Extends I {}
Inheritance tree
Symbol table
Memory allocation table