我市公布首批525项市级 部门“最多跑一次”事项清单
![]() | ?? ??? ??? ??????? ?? ????? ???? ???? ??? ??? ????? ????????? ??????? ?? ????? ?????? ?? ??? ??? ????? ????? ???????? ??????? ???????? ?? ??? ??????? ???? ??? ??? ????? ?? ???? ??? (??? 2015) ????? ?????: "?????" – ?????? · ????? ??????? · ??????? · ??????? · ??????? (JSTOR) |
????? (Class) ???????????? ?????? ??? ???????? ?? ????? ?? ????? ?????? ?? ?? ?????? ?? ?? ?? (?? ????, variable) ???? ???? ???? ???? ?? (????) ???? ?? ???????????? ???????? ??? ????? ???????? (Object) ???? ???? ?? ????? (?? ???? ??? ????????) ?? ??? ?? ?? (variable) ??? ??????? (function, ???????) ?? ???? ???? ?? ?? ???????? (private), ??????????? (protected) ?? ?????? (public) ?? ???? ???? ???? ?? ????? ?? ????? ?? ?? ????? ????? ?? ??????? ?? ?? ???? ?? ?? ???? ????? ?? ???? ????? ?? ????
????? ??????? ?? variable ?? function ?? ?????? ??? ??? class ????? ?? ?????? ???? ???? ?? variables ??? function ???? ?? ???? ??? (???? ?? ??? ??? ?????, ?????)? ????? ????? ?? ?????? ?? ??? ?????? ?? ???????? ??????? ???? ?? ???? ???, ?? ???????????? ????? ?? ?????? ??? ????? ?? ?????? ???? ???? ?? ???? ?? ??? ?? variable (?? function) ?? define ???? ????? ??? ??????-?????? ???? ???? ?? ?????? ?? ??? ??? int ?? ?????? ????????? ???? ?? - ???, ????? ?? ??? (int day, int month, int year)? ??? ???? ?? ????? ?? ??? ????????? ???? ?? ???-??? ?? ?? ?????? ?? ??????? ?? ??? ?? ???? ??? Class Date {int day, month, year); Date d1, d2,d3 ...? ??? ?????? ????? ?? ???? ??? ??????? (function) ?? ???? ????????? ???? ?? ?? ??? ????? ?? ??????? ?? ??? ??? ???? ???? ??, ???? ???? ?? ??? ????????, ???? ?? ???? ?????? ?? ?? ??????? ???, ??????? ????? ?? ??? ?? ???? ???? ?? ???? ?? ?? ????? ?? ???? ????????? ?? ????
????? ?? ??????? ?? ?????? ??????, ???????????? ?? ?? ?? ?????? ?? ??? ?? ??????? ????? ?? ????? ????? ??????? ?????? ??? ???????? ????? ?? ??? ????? ??? ??? - ?? ??? ??? ????? ??? ???????? (???? ???? ????? ????? ?? ??? ????), ?? ????? ??? ?? ???? (???????) ?? ?????? ?? ???? ?????? ????????? ???? ?? ????????? ??? ???? ???? ????? C++ ???? ?? ???? ????? ????? ???? ??? ??, ????? ???? ????????? ?? ???? ?????? ??? ?? ????? ?? ????? ???????? ?? ??? ????? ???
????? ?? ?????? - ??????
[??????? ????]?? ??????? ????? ?? ?? ?????? ?? ?????? ?? ?????? ???? ?? ???? ?? :
Class A {... };
A a1;
???? ????? ?????? ??? ????? (????? ??? A ??) ?? ??????? ?? ????? ?????? ??? ????? ?? ?????? ?? ?? ??? ?? (????????) ????? ??? a1 ??, ?? ????? ??? ??? a1, A ?????? ?? ?? ???????? ??? ??? ??? ?????? ??? ????? ?? ???? ?? ??????? ???? ????? ?? ??? ?? ?????? ?? ??? ??? ??????? ?? ?????? ?? ???? ?? :
Class A {
int x,y;
float p;
int subtract() {return x-y;}
};
??????? ??? ??? ????? ?? ???? ?? int ?? (x ?? y), ?? float ?? (p) ?? ?? function ?? (????? ??? subtract ??) ?? int ?????? ?? ???? ?? ???? (x ?? y) ?? ????? ???? ???
????? ?? ?????????
[??????? ????]????? ?? ?????? ?? ???? ?? ??-?????????? ?????? ???-??? ????? ??? ???? ???? ???? ???????????? ?? ???? ????? ??? ???? ????? ??????? ???? ???-??????, ??????? ?? ????????? ?? -
????????
[??????? ????]?? Class ?? ???? ????? ????? ?? derive ???? ?? ???????? ???? class ?? ?? ?????? ???? ?? - ?? ????? ????? ??? ??? ?? ??? ?????? ???? ?? ???? ?? ?? ???? ????? ??? ???? ?? ???? ??? ??????-?????? ??? Date class ??? ?? ?? ??, ?????? ?? ??? (???? ???) ?????? ?? ?? ????? ???? ????? ???? -
Class Date2 : Date
{
int dayOfWeek;
};
????, Date2 class ??? ???, ????? ?? ??? ?? ??? variable define ?? ???????? ???? ????, ??????? ?? Date class ??? ???? ?? ????? ??? ???? ??? Date2 class ?? variable ???? ?? ?????? ???? ?? ???? ??? :
Date2 d2;
d2.day=21; d2.month=4; d2.year=2008; d2.dayOfWeek=4; // Meaning Thursday
???????
[??????? ????]???????????? ?????? ??? ??? polymorphism ???? ???? ??? class ???? ?????? ???? ????? class ??? ?? ??? ??? ??? ?? ???? ??? ??? ???? ?????? ??? Class A ?? ?? ??? ????? B ????? ?? ???? ?? ?? subtract ?? ?? ?????? ????????? ???
Class A {
int x,y;
float p;
virtual int subtract() {return x-y;}
};
Class B : A
{
int subtract () {
if(x>y) return x-y;
else return y-x; //???? ?? ???? ?? ????? ?? ???? ?????, ????? ????? positive ????
}
};
???? virtual ?? ?????? ???? ??? ???
???? ??????? ????
[??????? ????]- Abadi; Cardelli: A Theory of Objects
- ISO/IEC 14882:2003 Programming Language C++, International standard
- Class Warfare: Classes vs. Prototypes, by Brian Foote
- Meyer, B.: "Object-oriented software construction", 2nd edition, Prentice Hall, 1997, ISBN 0-13-629155-4
- Rumbaugh et al.: "Object-oriented modeling and design", Prentice Hall, 1991, ISBN 0-13-630054-5