Test I! The situation of =i
public class doubletest{
public static void Main (string[] args) {
Double i=0.0/0.0;//0.0/0.0 is meaningful in the canonical operation of floating-point numbers, which are not equal to any number and are not equal to themselves.
Java in the IEEE package specifies that this is not a number, NaN
if (i==i) {
System.out.println ("Yes,i==i");
}else{
System.out.println ("No,i!=i");
}
}
}
public class jioutest{
public static void Main (string[] args) {
int i=21;
if (i%2==1) {//This code can only test positive number of parity can not test negative numbers
System.out.println ("I is odd");
}else{
System.out.println ("I is not odd");
}
}
}
Arrays: 1, defining arrays
--int[] ARR; Declaration of an Array (reference)
Arr=new Int[5]: The length of the array to be written in instantiation--[]
2, Array instantiation
3, Array Assignment
4, iterating through the array
--1,2 merger: int[] Arr=new int[5];
--declaration, instantiation, assignment of the initial value of the merger:
--int[] arr=new int[]{...,...,...}; Cannot write array length in--[]
--int[] arr={...,...,...};
Two-dimensional array: int[][] arr;
Arr=new Int[3][5];
Int[][] Arr={{1,2,3},{4,5},{6}};
Note: An array in Java is an object and cannot be crossed, otherwise an exception will occur.
Array copy (copy of Array)
int myarray[]={1,2,3,4,5,6};
int hold[]={10,9,8,7,6,5,4,3,2,1};
System. Arraycopy (myarray,0,hold,0,myarray.length);
(the original array name, the starting position of the copied element in the original array, the target array name, the target array to accept the starting position of the element, the copy length)
I =i test, Java array