.
,
: . -
, .
, . -
.
-
, -
.
: public, private, protected internal.
protected 9. i n t e r n a l
(assembly) public -
, , .
p r i v a t e
, . ,
private- . , ,
.
2. , -
, , -
, .
3. , -
(.. ),
.
4. , -
, ,
, -
.
5. , ,
.
6. ,
.
10. : , , .
. ,
, . -
. :
_{) {
// }
, ,
# ,
-, , , -
- 11-. -
|
|
, .
. -
, -
. , : -
.
, . .
.
#
, , .
(method overloading), ,
, (overloaded). -
#.
. .
: -
, / . -
. -
. -
, ( ) -
. , ovlDemo () .
, ,
, double-. -
, ovlDemo () void, ..
,
. , -
, . -
, ovlDemo () , .
-
.
12. : .
. -. static.
, -
.
. , -
, .. . -
, s t a t i c.
s t a t i c,
. s t a t i c
, . static- "". . s t a t i c -
|
|
, . -
, 10 static- count, -
Timer, :
I Timer.count = 10; static- .
1. static- this.
2. static- static-.
. ,
,
static-.
3. static- static-.
, -
.
13. : , .
, . . const. , . -. - - , ( ) . const, ,
, (constants), -
const, , -
. - const, -
. -, ,
-
( ). -,
- .
14. (try/catch/throw-).
( ) ,
. #- -
, . -
,
"". , -
,
. , ,
. "
", , -
, -
. -
. , -
. #
, . , -
, try-. ,
. -
catch- -
.
#- . ,
|
|
throw. ,
try-, finally. t r y catch.
" "; t r y catch catch
try. try/catch- :
t r y {
// , .
}
catch {ExcepTypel exOb) {
// ExcepTypel.
}
catch (ExcepType2 exOb) {
// 2.
}.
. ^ try/catch-, try- , catch-. #-, -
, : .
.
, #- -
. , -
.
.
, .
.
. . , . , . - ,
17. ( ++).
, . , , . , . . , . , ( ), . , . (public) (protected) . , . :: ( ) .
++ . . , . public, ,
. (public) (protected) . .
protected ( ), , (public) (protected) , , .
|
|
( private) , , , , .