java 资料(java 资料)
The fourth chapter of the behavior of objects (operation instance variables)
At the beginning of that picture, every time I saw it, I wanted to laugh. (the expression and action of the goods were all in place = = the one on the back page, and the jokes were very powerful ~!). Well, this chapter is mainly around the object to explain some skills.
Depending on the ing argument (arguments) or the instance variable (instance variable) of the object, the same method can have different representations in different objects of the same type.
The argument (arguments) is the actual value passed to the method, and it es a parameter after the method is passed in. The parameter (parameters) and local variable (local) is similar to the same. Changing the parameter does not change the argument. (like C) the type of the value of the parameter passed in and returned can be implicitly enlarged or explicitly reduced.
You can return a value from the method, the best return statement to return (I found the statement when the code returns does not return to the wrong P78, but the final answer to the question is not so embarrassed, generally only), return a value, but can return an array, then deep, can return to the ArrayList, in other words, as long as you have a good package, can be bination of any variable to return any number of any type. (it's too powerful.)
Java is called pass by value, and if the calling argument is a reference variable, the same copy is used.
With setter (mutator) and getter (accessor) encapsulation (encapsulation), the object instance variables can be guaranteed by setting setter to prevent spoof. (setting instance variables with private, setting setter and getter with public), reducing the efficiency of reading and changing instance variables, but improving the resistance, resilience and resilience of programs.
Instance variables have default values (shaping 0, floating point 0, Boolean false), and local variables have no default values
java 资料(java 资料) 来自淘豆网m.daumloan.com转载请标明出处.