Home > Back-end >  Why can the String as a member variable?
Why can the String as a member variable?

Time:10-10

Other classes may also as a member variable? What do I do that?
Just less than a month to learn Java, a great god answer

CodePudding user response:

Why can't a String as a member variable??

CodePudding user response:

In addition to the constant is variable!
Variables are in the program is running can change the string class can, of course

CodePudding user response:

refer to the second floor weixin_43102797 response:
is in addition to a constant variable ah
Variables are in the program is running can change the string class can of course
custom class can also? Do not add new keywords

CodePudding user response:

reference 1st floor sotondolphin response:
why can't a String as a member variable??
if the other classes can also be as member variables

CodePudding user response:

What you said as a member variable is not a "String class
"But "String class" a "objects" of the "reference"

Such as a "members" of other classes,
We call this the "inner class
"
But I think, you said "members" most cases should only refer to "a class object reference"
  • Related