172.16.0.151_20200909-陈政平

问题

    public static void main(String[] args) {
    List<Integer> source = List.of( 100 , 20 , 99 , 78 , 9527 , 1 , 0 , -8526 );
    System.out.println( source );
    
    System.out.println( "- - - - - - - - - - - - - - - - - - - - - - -" );
    
    List<Integer> list = List.copyOf( source );
    System.out.println( list );
    
    System.out.println( source == list ); // true
    
    System.out.println( "- - - - - - - - - - - - - - - - - - - - - - -" );
    
    Collection<String> collection = Set.of( "王盼盼" , "怎么又是你" , "达旭辉" );
    System.out.println( collection );
    List<String> x = List.copyOf( collection );
    System.out.println( x );
    System.out.println( collection == x );//false

System.out.println( source == list ); // true 这里比较的是同一个对象,他们指向同一个内存空间,所以地址相同

System.out.println( collection == x );//false 这里比较的是所存储地址的值,因为List和Collection是两个存储空间,他们指向两个对象,所以地址不同返回 false