1. Packages (package) in Java
2.1 packages, corresponding to folders on disk
2.2 Create a new class that defaults to the default package
2.3 Declaring the Package keyword: packages
Package statement, pinned location
2.4 Importing a package keyword: import
Import package name. Class Name (* denotes all);
2.5 Effects:
Classify, resolve conflicting names
Classify and store, easy to find and manage
2.6 Naming conventions--reference materials
2 . Methods with Parameters
2.1 How to declare
Public return type method name (data type parameter name) {
.... Method body
}
2.2 Divided into 2 categories
2.2.1 No return type--void
2.2.2 has return type
Basic data types
Custom Classes-- return object of the class ;
Arrays-- return Array name ;
2.3 Types of parameters
Basic data Type (10-31)
Custom Classes--passing objects of a class
Array--only the "array name" needs to be passed
2.4 Calls
2.4.1 called in the current class--Method name (value list);
2.4.2 called in other classes--object name. Method Name (value list);
Iii. Summary of methods
Classification:
1, no return type, no parameters
2, no return type, parameters
3, there is a return type, no parameters
4. There are both return types and parameters
parameter or return type, which can be a common data type or a custom class or array
Java Learning (11)