• 两种数组,注意用法


    1、vo里面定义的方法  前端都是传数组。唯一区别是在 setShopId 方法里面

        public void setShopId(Long  shopId) {
        	if(shopId != null && shopId != 0L){
                setShopIds(shopId);
        	}
        }
        
        public void setShopIds(Long ... shopIds) {
            this.shopIds = shopIds;
        }
    

    2、vo里面定义的方法  前端都是传数组。

      public void setShopId(Long  shopId) {
        	if(shopId != null && shopId != 0L){
    			Long[] shopIds = new Long[]{shopId};
        		setShopIds(shopIds);
        	}
        }
        
        public void setShopIds(Long[] shopIds) {
            this.shopIds = shopIds;
        }
    
    	public static void main(String[] args) {
    		Long shopId = 1L;
    		Long[] shopIds = new Long[]{shopId};
    		System.out.println(JSON.toJSONString(shopIds));
    	}
    

    参考:https://www.cnblogs.com/epeter/p/5664926.html

  • 相关阅读:
    QT1 HelloWorld
    SDL2.0 播放YUV
    vim寄存器
    Makefile模板
    apue初学--DIR
    apue初学--平台的判断
    各种推导式
    文件操作
    list tuple dict set
    字符串和编码
  • 原文地址:https://www.cnblogs.com/time-on/p/9843359.html
Copyright © 2020-2023  润新知