Hello and welcome :-)

When a method is ��  public �� , it means that it is usable by any other object in the system.

In Pharo, methods are ��  public ��  and instance variables are �� protected ��. 

��  protected �� means that the instance variable is only usable from inside the class defining it or from subclasses of the class defining it.

Some languages (as Java) define the concepts of �� private �� method / instance variable which means that the method / instance variable can only be accessed from the class defining it (and not its subclasses) and ��  package �� which means that the method / instance variable can only be accessed from classes inside the same package.

In fact, in java you can choose the visibility you want for each method / instance variable. In Pharo, this is fixed, methods are ��  public ��  and instance variables are �� protected ��. So you do not need to bother.

All these concepts are related to encapsulation [1] which is an important concept of OOP.

BTW, there are some posts related to your question on StackOverflow [2] which I recommend to you.

Cheers,

Julien

Links:
[1]: https://en.wikipedia.org/wiki/Object-oriented_programming#Encapsulation
[2]: https://stackoverflow.com/questions/2647289/what-does-it-mean-for-a-method-to-be-public-private-other-in-java

---
Julien Delplanque
Doctorant �� l���Universit�� de Lille
B��timent B 40, Avenue Halley 59650 Villeneuve d'Ascq
Num��ro de t��l��phone: +333 59 35 86 40

Le 15 nov. 2018 �� 05:43, iu136 via Pharo-users <pharo-users@lists.pharo.org> a ��crit :


De: iu136 <iu136@yahoo.com>
Objet: Question about pharo's object model
Date: 15 novembre 2018 �� 05:43:45 UTC+1


hello guys
I'm new to programming, I started programming using pharo, I had a question
about pharo's object model. In object model we say, methods are public. What
does "public" mean here?
thanks



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html