• 工作中测试类1


    public class TempTest {
        private void test1(A a){
        }
        public static void main(String[] args) {
        TempTest t = new TempTest();
        A a = new A();
        t.test1(a); //这里传递的参数a就是按引用传递
        }
        }
        class b{
        public int age = 0;
        }
    public class TestDate {
    
        /**
         * @param args
         * @throws ParseException 
         */
        public static void main(String[] args) throws ParseException {
            String dateStr="20101010101010";
            SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
            Date date=sdf.parse(dateStr);
            Calendar rightNow=Calendar.getInstance();
            rightNow.setTime(date);
            rightNow.add(Calendar.DATE, 7);
            Date d=rightNow.getTime();
            String dStr=sdf.format(d);
            System.out.println(dStr);
            Date now=new Date();
            
            if(now.after(d)){
                System.out.println("OK");
            }
    
        }
    
    }
    public class TestFunction {
    
        /**
         * @param args
         */
        public static void main(String[] args) {
            TestFunction t=new TestFunction();
            A a = new A();
            Integer b = null;
            Map<String, Integer> map=new HashMap<String, Integer>();
            map.put("b", b);
            
            t.test3(map);
            
            t.test1(a);
            System.out.println(a.aa);
            System.out.println(map.get("b"));
    
        }
        private  void test1(A a){
            test2(a);
        }
        private  void test2(A a){
            a.aa=111;
        }
        private  void test3(Map<String, Integer> map){
            test4(map);
        }
        private  void test4(Map<String, Integer> map){
            int bb=map.get("b");
            bb=2222;
            map.put("b", bb);
        }
    
    }
    class A{
        public int aa = 0;
        }
    public class TestList {
    
        /**
         * @param args
         */
        public static void main(String[] args) {
            
            List<String> a=new ArrayList<String>();
            a.add("1");
            a.add("2");
            String b=a.remove(0);
            System.out.println(b);
        }
    
    }
    public class RegexMatches {
        
        public static void main(String args[]) {
            String str = "Pp000dsaP";
            String pattern = "(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]{6,25}";
    
            Pattern r = Pattern.compile(pattern);
            Matcher m = r.matcher(str);
            System.out.println(m.matches());
        }
    
    }
  • 相关阅读:
    点餐网站学习(EF+MVC)SEO站内结构
    点餐网站学习(EF+MVC)EF工具,自动创建模型并建立数据库映射关系
    个性化定制cms介绍
    EasyUI Munubutton 二级菜单
    程序员也是文艺青年
    EasyUI combobox加入请选择 [.net后台代码]
    LVS配置记录
    查询MYSQL库表使用空间
    python django 数据库操作
    Nginx修改版本信息或隐藏版本号
  • 原文地址:https://www.cnblogs.com/landauni/p/6763542.html
Copyright © 2020-2023  润新知