There is one difference between undefined And null in javascript :: undefined is a data type and null is a value defined empty variable is null of datatype undefined Both of them are representing a value of a variable with no value AND null doesn't represent a string that has no value Like var a = '' ; console . log ( typeof a ); // string var a = '' ; console . log ( a == null ); //false console . log ( a == undefined ); // false Now if var a ; console . log ( a == null ); //true console . log ( a == undefined ); //true BUT var a ; console . log ( a === null ); //false console . log ( a === undefined ); // true SO each one has it own way to use undefined use it to compare the variable data type null use it to empty a value of a variable var a = 'javascript' ; a = null ; // will change the type of variable "a" from string to undefined
博文
目前显示的是 一月, 2014的博文
Java Convert BufferedImage to SWT ImageData
- 获取链接
- X
- 电子邮件
- 其他应用
public ImageData bufferedImage2SwtImage(BufferedImage bufferedImage) { if (bufferedImage.getColorModel() instanceof DirectColorModel) { DirectColorModel colorModel = (DirectColorModel) bufferedImage.getColorModel(); PaletteData palette = new PaletteData(colorModel.getRedMask(), colorModel.getGreenMask(), colorModel.getBlueMask()); ImageData data = new ImageData(bufferedImage.getWidth(), buf...