-7

What does private MesgBean bean mean?Does it create the object called bean of the class MesgBean? Or it only define it is the private?

enter image description here

Nimantha
  • 6,405
  • 6
  • 28
  • 69
  • 2
    It's very hard to understand what you are asking, but you should probably go and read up some basics about classes: [Java Tutorials: Declaring Member Variables](https://docs.oracle.com/javase/tutorial/java/javaOO/classvars.html) – OH GOD SPIDERS Mar 05 '18 at 11:32
  • See https://stackoverflow.com/questions/10115588/what-is-the-difference-between-field-variable-attribute-and-property-in-java – GhostCat Mar 05 '18 at 11:34
  • This is a **field** in your class. Super basic stuff, written up in any good book or tutorial. Seriously: consider deleting this question. – GhostCat Mar 05 '18 at 11:35
  • Ghostcat, is there a lower limit on how basic SO questions are allowed to be ? – Erwin Smout Mar 05 '18 at 11:39
  • 1
    @ErwinSmout That is a bit of grey area. If it is so basic that you encounter it doing 1 minute of research, consider it to be basic. And the other point is: this is a duplicated question. Unfortunately I voted for "close as unclear" before figuring that I should have closed as duplicated instead. – GhostCat Mar 05 '18 at 11:41
  • @ErwinSmout And beyond that: look here: https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users – GhostCat Mar 05 '18 at 11:41

2 Answers2

0

It just creates an object from the MesgBean class. The object remains NULL until you initialize it using constructor. This does not have any connection with being public or private.

0

It declares a member in the type that this declaration appears in.

The member's name is "bean".

The member's type is "MesgBean" (in the same package as the one of the type (/class) that this declaration appears in).

The member is not initialized.

And the "private" part means the member will only be visible to code within this type.

Erwin Smout
  • 18,113
  • 4
  • 33
  • 52