�g�����́A���������ȉ��̂悤�ɂȂ�Btypedef struct { char *FirstName, *LastName, *PresentAddress; int BirthYear, BirthMonth, BirthDay, } Person;
�����ŁA����̃f�[�^����N����v�Z����悤�Ȏ葱���̓f�[�^�ɉ����ǂ̂悤�� ����邩�ɂ���Č��܂��Ă�����̂ł��邱�ƂɋC�Â��ƁAPerson �̒�`�� ���ɂ��̎葱������ꂽ�����悢���Ƃ��킩��B����ɁA�f�[�^�̃Z�b�g�� �ύX�ɂ����ꂼ��葱�����g���悤�ɂ���B�f�[�^�Ƃ��̑���@���L�q���� �v���O�������ЂƂ܂Ƃ߂ɂ������̂��A�I�u�W�F�N�g�ƌĂсA�I�u�W�F�N�g�̒�` �� Class �ƌĂԁB... Person Tsutomu = {"Tsutomu","Kikuchi","Akebono-cho, Kochi",1981,2,16}, Mariko = {"Mariko","Kikuchi","Akebono-cho, Kochi",1983,10,28}, Takashi = {"Takashi","Nakamura","Shobuzawa, Fujisawa",1978,8,18}; ... main() { ... printf("Age of %s is %d\n",Tsutomu.FirstName,AgeOf(&Tsutomu)) ... } ... int AgeOf(Person *person) { ... age=...- (person->BirthYear)... }
��F����(C++)
class Person { char FirstName[20], LastName[20], PresentAddress[40]; int BirthYear, BirthMonth, BirthDay; public: viod setFirstName(char aName[]); void setLastName(char aName[]); ... char* getFirstName(); int age(void); }; void Person::setFirstName(char *aName) { strcpy(FirstName,aName); } ... char* Person::getFirstName(void) { return ((char*)FirstName); } int Person::age(void) { int a; a = ... - BirthYear ...; return(a); } main() { Person Tsutomu,Mariko,Takashi; Tsutomu.setFirstName("Tsutomu"); ... cout << "Age of " << Tsutomu.getFirstName() << "is" << Tsutomu.age(); }
class �Ŏw�肵�����O�� .class �t�@�C�����ł��邱�Ƃɒ��ӁBF:\home\papa\java>javac ex01.java F:\home\papa\java>java Hello Hello!
Applet �v���O���~���O�̗� (class �̖��O�� .java �t�@�C���̖��O�ɂ���K�v������...�炵���B)�R���p�C���Ǝ��s�́A
Netscape �ł݂����Ƃ��ł���BF:\home\papa\java>javac HelloApplet.java F:\home\papa\java>appletviewer Hello.html
CLASSPATH=.;g:\java\lib\classes.zip;c:\Program Files\Netscape\Navigator\Program\Java\classes PATH=G:\NETPBM\BIN;G:\JAVA\BIN;C:\PTEX\BIN;C:\DJGPP\BIN;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\MWW\DLL;C:\MWD\MANAGER;C:\THINKPAD;�̂悤�� PATH, CLASSPATH �̐ݒ�����Ă����K�v������܂��B
���̑��� applet ���������Č��悤�B �v���O�����̗����͕K���������₷���� �������A�ǂ����ǂ��ς���Ɖ����N���邩�����Ă݂�ƁAApplet Programming �̗������i�ނł��낤�B