zoukankan      html  css  js  c++  java
  • UC

    public class Test{
        public static void main(String args[]){
            int i[]= new int[1];
            System.out.println(i.equals(0));
            
        }
    }
    //false
    import static org.junit.Assert.*;
    import org.junit.Test;
    public class test {
        @Test
            public void test(){
                int i[]= new int[1];
    //            assertNotNull/Null
    //            assertSame/NotSame 指向同一内存地址(实例)
    //            fail([String message])中断测试方法,输出message.让测试失败,并给出指定信息。
                assertFalse(i.equals(0));//false
                assertEquals(i[0],0);//true
                
            }
    }
    public class Test2{
        public static void main(String args[]){
            int i = Integer.MAX_VALUE;
            long j = i+1;
            System.out.println(j>i);
            System.out.println(j);
            System.out.println(i);
            
        }
    }
    //false
    //-2147483648
    //2147483647
    public class Test{
        public static void main(String args[]){
            B b=new B();
            b.printValue(1);
            System.out.println(b.i);//0
        }
    }
    class B {
        int i=0;
        public void printValue(int i){
            i=i;
        }
    }
    class B {
            int i=0;
            int j=0;
            public void printValueI(int i){
                this.i=i;
            }
            public void printValueJ(int j){
                j=j;
            }
        }
        @Test//通过测试
        public void test2(){
            B b=new B();
            b.printValueI(1);
            assertEquals(b.i, 1);
            b.printValueJ(1);
            assertEquals(b.j, 0);
        }
  • 相关阅读:
    计算机网络 chapter 6 应用层
    计算机网络 chapter 4 网络层
    计算机网络 chapter 2 物理层
    计算机网络 chapter3数据链路层
    计算机网络 chapter 1 概述
    文章
    进程池线程池 协程
    MySQL
    同步锁 死锁与递归锁 信号量 线程queue event事件
    GIL全局解释器
  • 原文地址:https://www.cnblogs.com/seven7seven/p/3728995.html
Copyright © 2011-2022 走看看