<! --
/* Font Definitions */
@ Font-face
{Font-family:;
Panose-1: 2 1 6 0 3 1 1 1 1 1;
MSO-font-alt: simsun;
MSO-font-charset: 134;
MSO-generic-font-family: auto;
MSO-font-pitch: variable;
MSO-font-Signature: 3 135135232 16 0 262145 0 ;}
@ Font-face
{Font-family:;
Panose-1: 2 1 6 0 3 1 1 1 1 1;
MSO-font-alt: simhei;
MSO-font-charset: 134;
MSO-generic-font-family: auto;
MSO-font-pitch: variable;
MSO-font-Signature: 1 135135232 16 0 262144 0 ;}
@ Font-face
{Font-family: "\ @ ";
Panose-1: 2 1 6 0 3 1 1 1 1 1;
MSO-font-charset: 134;
MSO-generic-font-family: auto;
MSO-font-pitch: variable;
MSO-font-Signature: 1 135135232 16 0 262144 0 ;}
@ Font-face
{Font-family: "\ @ ";
Panose-1: 2 1 6 0 3 1 1 1 1 1;
MSO-font-charset: 134;
MSO-generic-font-family: auto;
MSO-font-pitch: variable;
MSO-font-Signature: 3 135135232 16 0 262145 0 ;}
/* Style definitions */
P. msonormal, Li. msonormal, Div. msonormal
{MSO-style-parent :"";
Margin: 0 cm;
Margin-bottom:. 0001pt;
Text-align: justify;
Text-justify: Inter-ideograph;
MSO-pagination: none;
Font-size: 10.5pt;
MSO-bidi-font-size: 12.0pt;
Font-family: "Times New Roman ";
MSO-Fareast-font-family:;
MSO-font-kerning: 1.0pt ;}
H1
{MSO-style-Next: body;
Margin-top: 172.16pt;
Margin-Right: 0 cm;
Margin-bottom: 16.5pt;
Margin-left: 21.25pt;
Text-align: justify;
Text-justify: Inter-ideograph;
Text-indent:-21.25pt;
Line-Height: 240%;
MSO-pagination: lines-together;
Page-break-after: Avoid;
MSO-Outline-level: 1;
MSO-list: L1 level1 lfo1;
Tab-stops: List 21.25pt;
Font-size: 22.0pt;
Font-family: "Times New Roman ";
MSO-font-kerning: 22.0pt ;}
H2
{MSO-style-Next: body;
Margin-top: 13.0pt;
Margin-Right: 0 cm;
Margin-bottom: 13.0pt;
Margin-left: 1.0;
Text-align: justify;
Text-justify: Inter-ideograph;
Text-indent:-1.0;
Line-Height: 173%;
MSO-pagination: lines-together;
Page-break-after: Avoid;
MSO-Outline-level: 2;
MSO-list: L1 level2 lfo1;
Tab-stops: List 1.0;
Font-size: 16.0pt;
Font-family: Arial;
MSO-Fareast-font-family:;
MSO-bidi-font-family: "Times New Roman ";
MSO-font-kerning: 1.0pt ;}
H3
{MSO-style-Next: body;
Margin-top: 13.0pt;
Margin-Right: 0 cm;
Margin-bottom: 13.0pt;
Margin-left: 0 cm;
Text-align: justify;
Text-justify: Inter-ideograph;
Line-Height: 173%;
MSO-pagination: lines-together;
Page-break-after: Avoid;
MSO-Outline-level: 3;
Font-size: 16.0pt;
Font-family: "Times New Roman ";
MSO-font-kerning: 1.0pt ;}
P.4, li.4, div.4
{MSO-style-name: "style Title 4 ";
MSO-style-parent: "Title 3 ";
Margin-top: 13.0pt;
Margin-Right: 0 cm;
Margin-bottom: 13.0pt;
Margin-left: 35.45pt;
Text-align: justify;
Text-justify: Inter-ideograph;
Text-indent:-35.45pt;
Line-Height: 173%;
MSO-pagination: lines-together;
Page-break-after: Avoid;
MSO-Outline-level: 3;
MSO-list: L1 level3 lfo1;
Tab-stops: List 35.45pt;
Font-size: 15.0pt;
MSO-bidi-font-size: 16.0pt;
Font-family: "Times New Roman ";
MSO-Fareast-font-family:;
Font-weight: bold ;}
/* Page Definitions */
@ Page
{MSO-page-border-Surround-header: No;
MSO-page-border-Surround-footer: No ;}
@ Page Section1
{Size: 612.0pt 792.0pt;
Margin: 72.0pt 90.0pt 72.0pt 90.0pt;
MSO-header-margin: 361_pt;
MSO-footer-margin: 36366pt;
MSO-paper-Source: 0 ;}
Div. Section1
{Page: Section1 ;}
/* List Definitions */
@ List l0
{MSOs-list-ID: 1147820946;
MSO-list-type: hybrid;
MSO-list-template-IDs:-539340266 287331220 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715 ;}
@ List l0: level1
{MSO-level-tab-stop: 18.0pt;
MSO-level-number-position: left;
Margin-left: 18.0pt;
Text-indent:-18.0pt ;}
@ List L1
{MSOs-list-ID: 1390962552;
MSO-list-template-IDs: 1939346452 ;}
@ List L1: level1
{MSO-level-style-link: "Title 1 ";
MSO-level-tab-stop: 21.25pt;
MSO-level-number-position: left;
Margin-left: 21.25pt;
Text-indent:-21.25pt ;}
@ List L1: level2
{MSO-level-style-link: "title 2 ";
MSO-level-text: "% 1 \. % 2 \.";
MSO-level-tab-stop: 1.0;
MSO-level-number-position: left;
Margin-left: 1.0;
Text-indent:-1.0 ;}
@ List L1: level3
{MSO-level-style-link: "style Title 4 ";
MSO-level-text: "% 1 \. % 2 \. % 3 \.";
MSO-level-tab-stop: 35.45pt;
MSO-level-number-position: left;
Margin-left: 35.45pt;
Text-indent:-35.45pt ;}
@ List L1: level4
{MSO-level-text: "% 1 \. % 2 \. % 3 \. % 4 \.";
MSO-level-tab-stop: 42.55pt;
MSO-level-number-position: left;
Margin-left: 42.55pt;
Text-indent:-42.55pt ;}
@ List L1: level5
{MSO-level-text: "% 1 \. % 2 \. % 3 \. % 4 \. % 5 \.";
MSO-level-tab-stop: 49.6pt;
MSO-level-number-position: left;
Margin-left: 49.6pt;
Text-indent:-49.6pt ;}
@ List L1: level6
{MSO-level-text: "% 1 \. % 2 \. % 3 \. % 4 \. % 5 \. % 6 \.";
MSO-level-tab-stop: 2.0;
MSO-level-number-position: left;
Margin-left: 2.0;
Text-indent:-2.0 ;}
@ List L1: level7
{MSO-level-text: "% 1 \. % 2 \. % 3 \. % 4 \. % 5 \. % 6 \. % 7 \.";
MSO-level-tab-stop: 63.8pt;
MSO-level-number-position: left;
Margin-left: 63.8pt;
Text-indent:-63.8pt ;}
@ List L1: level8
{MSO-level-text: "% 1 \. % 2 \. % 3 \. % 4 \. % 5 \. % 6 \. % 7 \. % 8 \. ";
MSO-level-tab-stop: 70.9pt;
MSO-level-number-position: left;
Margin-left: 70.9pt;
Text-indent:-70.9pt ;}
@ List L1: level9
{MSO-level-text: "% 1 \. % 2 \. % 3 \. % 4 \. % 5 \. % 6 \. % 7 \. % 8 \. % 9 \. ";
MSO-level-tab-stop: 77.95pt;
MSO-level-number-position: left;
Margin-left: 77.95pt;
Text-indent:-77.95pt ;}
Ol
{Margin-bot: 0 cm ;}
Ul
{Margin-bot: 0 cm ;}
-->
1.1.
Embedded class
1.1.1.
Code
/*
*
Change this template, choose tools | templates
*
And open the template in the editor.
*/
Package javatutorials;
/**
*
*
@ Author wanpor
*/
Public class innerclass {
Public static void main (string [] ARGs ){
//
Create static embedded classes
Innerclass. A ICA
= New innerclass. ();
ICA. printinfo ();
//
Create a non-static embedded class
Innerclass B = new innerclass ();
Innerclass. B ICB = B. New B ();
ICB. printinfo ();
}
//
Static embedded class
Public static Class {
Static void printinfo (){
System. Out. println ("");
}
}
//
Non-static embedded class
Public Class B {
Void printinfo (){
System. Out. println ("B ");
}
}
}
1.1.2.
Description
1.
Define static embedded classes;
2.
Define non-static embedded classes
3.
Create static embedded Class Object
4.
Create non-static embedded Class Object
Static classes cannot be instantiated. All members of a class are static members and static methods,
Non-static classes can be operated only after being instantiated, but interfaces and image classes cannot be instantiated directly.