npm init -y
-y 是初始化package.json的时候省略掉输入各种信息的步骤,都使用默认值
npm install module_name –save-dev
–save-dev 自动将依赖的模块加到devDependencies中
–save 自动将依赖的模块加到dependencies中
From code planet
-y 是初始化package.json的时候省略掉输入各种信息的步骤,都使用默认值
–save-dev 自动将依赖的模块加到devDependencies中
–save 自动将依赖的模块加到dependencies中
Runtime Exception:
在定义方法时不需要声明会抛出runtime exception; 在调用这个方法时不需要捕获这个runtime exception; runtime exception是从java.lang.RuntimeException或java.lang.Error类衍生出来的。 例如:nullpointexception,IndexOutOfBoundsException就属于runtime exception
Exception:
定义方法时必须声明所有可能会抛出的exception; 在调用这个方法时,必须捕获它的checked exception,不然就得把它的exception传递下去;exception是从java.lang.Exception类衍生出来的。例如:IOException,SQLException就属于Exception
Exception 属于应用程序级别的异常,这类异常必须捕捉,Exception体系包括RuntimeException体系和其他非RuntimeException的体系
RuntimeException 表示系统异常,比较严重,如果出现RuntimeException,那么一定是程序员的错误