package com.atguigu.java;import org.junit.Test;/*** @author Dxkstart* @create 2021-05-11 8:57*/public class IDEADebug {@Testpublic void test(){String str = null;StringBuffer sb = new StringBuffer();sb.append(str);System.out.println(sb.length());//4System.out.println(sb);//"null"StringBuffer sb1 = new StringBuffer(str);//抛异常System.out.println(sb1);//}}
