DataType
-------------
Basic data types
1.2 int
1.byte short int long float double
2.boolean[true,false]
3.char reference types
1.class
2.interface
3.[] Function
--------
function, methods, method
Encapsulates the function code.
Definitions cannot be nested. function format
---------
void parameter list
Modifier return value type function name (type 1 Name 1,...) {
function body
....
return;
} The invocation of the function
----------
function name () function overload (overload)
------------------
Recursive
----------
Array:
------------
Container with the same data type. Array definition
Number of------------elements = = Length of array
Type [] Variable name = new type [value];
int[] arr = net[10];
Arr.length;
Index out of bounds: java.lang.ArrayIndexOutOfBoundsException.
Null pointer exception: Java.lang.NullPointerExceptionjava no pointer
----------------
There is no explicit pointer operation. A reference is a pointer. The pointer is the memory address of the object.
NULL, the object does not exist, its properties and methods cannot be accessed, otherwise nullpointerexception.1. Define functions, Getmax (int[] arr), iterate through the array, and remove the maximum value of the int[] array.
int Getmax (int[] arr);
Network commands
-------------------
ipconfig//View IP Address
Ping 192.168.12.7//test whether the specified address is connected
Ping www.baidu.com//test the connectivity of the extranet
Ping www.baidu.com-t//test Network continuous connectivity
Class triangledemo{
public static void Ninexjiu () {
int line=9;
int row=1;
while (row<=9) {
int col=9;
while (Col >=row) {
System.out.print (col+ "*" +row+ "=" + (col *row) + "\ T");
col--;
}
row++;
System.out.println ();
}
}
public static int sum (int n) {
int sum=0;
for (int i=0;i<=100;i++) {
Sum=sum+i;
}
return sum;
System.out.println ("sum=" +sum);
}
public static void Ninexnine (int a) {
for (int x1=0;x1<=a;x1++) {
for (int y1=0;y1<=x1;y1++) {
System.out.print (x1+ "*" +y1+ "=" + (x1*y1) + "\ T");
}
System.out.println ();
}
}
public static void Main (string[] args) {
Triangledemo t=new Triangledemo ();
T.ninexnine ();
T.sum ();
Ninexjiu ();
Ninexnine (10);
System.out.println ("sum=" +sum (10));
}
}
class arrdemo{ public static void main (string[] args) { int [] Arr=new int [50 for (int x=0; x<arr.length;x++< Span style= "color: #000000") {arr[x] =x+1; for (int x=0;x<arr.length;x+ + "arr[" +x+ "]=" +arr[x]);
- Classes and objects:
- 1, the basic idea of object-oriented. 2, class with object (declaration, creation, use). 3, member variables and methods (Declaration and application). 4, parameter passing (base data type and reference type).
Method overloads:
1, method overloading. 2, constructor. 3, the constructor reloads. The use of 4,this.
- Access rights:
- 1, the use of the package (Package,import). 2, access permission modifier. 3, the encapsulation of classes (privatization, seter and Geter). 4,static (static member variable, method, Class). 5,final (modifier variables, methods, classes)
- Inherit the 1 class inheritance concept. 2, member inheritance. The use of 3,super. 4, call the parent class constructor.
- Polymorphic: 1, method of rewriting and hiding. 2, the variable is hidden. 3, the use of inheritance to achieve polymorphism. 4, the type conversion under inheritance. 5,instanceof.
Big Data Java Foundation one