import java.util.*;
public class T5 {
public static void main(String[] args)
{
int[] arr={15,5,87,7,53};
int[] arr2=new int[5];
//ystem.arraycopy(arr,0,arr2,0,5);
arr2=arr;
arr[1]=1;
for (int i=0;i<arr2.length ;i++ )
{
System.out.println("arr2:"+arr2[i]+" ");
}
System.out.println();
for (int i=0;i<arr.length ;i++ )
{
System.out.println("arr:"+arr[i]+" ");
}
//Arrays.fill(arr,8);
/*//Arrays.sort(arr);
//int a=Arrays.binarySearch(arr,15);
//System.out.print("\n"+a+" ");
System.arraycopy(arr,0,arr2,0,arr2.length);
*/
}
}
import java.util.*;
import java.text.*;
public class Test7 {
public static void main(String[] args)
{
//Date转换成字符串
Date date = new Date();
System.out.println("系统时间:"+date);
SimpleDateFormat sp1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") ;
System.out.println(sp1.format(new Date())) ;
//字符串转换成Date
try{
Date d = sp1.parse("2014-12-25 14:25:50");
SimpleDateFormat sp2 = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒") ;
System.out.println(sp2.format(d)) ;
}catch(ParseException e){
e.printStackTrace();
}
}
}
//ceil天花板 floor地板
/*double d = Math.ceil(2.11);
double e = Math.floor(2.11);
System.out.println(d);
System.out.println(e);
int a =9;
int b=10;
System.out.println(Math.min(a,b));
//round四舍五入
System.out.println(Math.round(2.5));
System.out.println("随机数:"+Math.random());
double g = Math.random();
System.out.println(g);
System.out.println(g*9);
System.out.println(g+1);
System.out.println((g*9+1)*100000);
System.out.println(Math.round((g+1)*100000));
//随机数
long r1 = (long)((Math.random()*9+1)*1000000000);
int r2 = (int)((Math.random()*9+1)*100000);
System.out.println("10位随机数"+r1);
System.out.println("6位随机数"+r2);*/
/*for(int i=0;i<100;i++){//0.011
System.out.println(Math.round((Math.random()*9+1)*100000));
}*/
Random r = new Random();
for(int i=0;i<100;i++){
System.out.println(r.nextInt(100));
}
double d = Math.round(-1.9);
double e = Math.ceil(-2.11);
double f = Math.floor(-2.11);
System.out.println("-2.11向上取整"+e);
System.out.println("-2.11向下取整"+f);