Issues in Agent-Oriented Software Engineering
Testo completo
Documenti correlati
• The member objects of your new class are typically private, making them inaccessible to the client programmers who are using the class. • This allows you to change those
Lipari (Scuola Superiore Sant’Anna) OOSD September 23, 2010 4 / 37G. Example
Non portable programs (must be recompiled) It is possible to declare a variable (or a function) and later define it (difference between .c and .h) Variables and functions can be in
res and s[] are local variables scope: body of function main lifetime: duration of the program. Lipari (Scuola Superiore Sant’Anna) Introduction to C++ November 15, 2010 27
Class declaration What follows is all private These are private variables What follows is protected A protected method What follows is public Constructor.. Classes
protected: only member functions of the same class or of derived classes can access it: other classes or global functions can’t public: every function can access it. class MyClass
public void setSender(String sender) { /* set sender;*/ } public void setReceiver(String receiver) { /* set receiver;*/ } public void setContent(String content) { /* set content;*/
Lipari (Scuola Superiore Sant’Anna) OO Design Principles October 28, 2011 1 /