Method
Definition of the method:
Modifier returns a value type function name (argument list) {EXECUTE statement; return value;} Because main is static, the defined function also needs to be static overload of the Staticpublic static xxx () {} function: In the same class, more than one function with the same name can exist. Only their number of parameters or the type of parameter can be different. Overloads and return value types don't matter, the return value types are different, and the others are identical and cannot exist in a class at the same time. When the function defined is the same, but the location of the operation is different, define the same function name representation function, but the parameter list differs to distinguish multiple functions with the same name. Example: Class Zx {public static void main (String args[]) {add; Add (+/-); } public static int add (int x,int y) {return x+y; } public static int add (int x,int y,int z) {return x+y+z; } stack: Store simple variables, object references, functions, and automatically release useless references and functions. Heap: Holds entities, objects, new, and entities in the heap have default initialization values, and when an entity is not referenced in the heap, it is recycled by the garbage collection mechanism in the Java Virtual machine over a period of time. Array definition Format: element type [] Array name = new element type [length];int [] number = new Int[10];int [] arr = new int [] {1,2,3,4,5}; properties: Arr.length//Array length AR Rays.sort (arr)//convert arr from small to large sort into binary num&15;nut=num>>>4;
Until Num<=15 can
Next time you understand and make it up. Upload code and operations for remainder: 78&3:78 remainder of 4, can be used with operations and bitwise operations to convert class Zx {public static void main (String args[]) {int a=600000; while (a>0) {System.out.println (a&7); a=a>>>3; } }}
Java 3&4 (functions, memory, arrays)