From ggc
|
01 packagepackage is used to name the directory or folder a class is in intermediate;
02
03 publicpublic is used to indicate unrestricted access (any other class can have access) classclass is a group of fields and methods used for making objects NullAndInitialization
04 {open braces start code blocks and must be matched with a close brace
05 privateprivate is used to restrict access to the current class only intint is the type for whole numbers and it is short for integer x;
06
07 privateprivate is used to restrict access to the current class only String y;
08
09 publicpublic is used to indicate unrestricted access (any other class can have access) intint is the type for whole numbers and it is short for integer getX()
10 {open braces start code blocks and must be matched with a close brace
11 returnreturn means to provide the result of the method and/or cease execution of the method immediately x;
12 }close braces end code blocks and must match an earlier open brace
13
14 publicpublic is used to indicate unrestricted access (any other class can have access) String getY()
15 {open braces start code blocks and must be matched with a close brace
16 returnreturn means to provide the result of the method and/or cease execution of the method immediately y;
17 }close braces end code blocks and must match an earlier open brace
18
19 publicpublic is used to indicate unrestricted access (any other class can have access) String toString()
20 {open braces start code blocks and must be matched with a close brace
21 returnreturn means to provide the result of the method and/or cease execution of the method immediately "x="+adds two numbers together or concatenates Strings togetherx+adds two numbers together or concatenates Strings together" and y="+adds two numbers together or concatenates Strings togethery;
22 }close braces end code blocks and must match an earlier open brace
23 }close braces end code blocks and must match an earlier open brace
|
Download/View intermediate/NullAndInitialization.java