首页 > 代码库 > 61 dfa 实现敏感词过滤

61 dfa 实现敏感词过滤

基本的概念

Class class=null  【只是在栈内存中有了指向,堆内存并没有分配内存】

Class class=new Class()【栈内存中有了指向(引用),堆内存也分配了内存】

 

map的嵌套实现树

Map<object,object> map = new HashMap<>();

 

Map<Object, Object> map = new HashMap<>();
        Map<Object, Object> temp =map;
        temp.put(1,1);
        Map<Object, Object> map1 = new HashMap<>();
        map1.put(1,"child");
        temp.put("child",map1);
        
        temp = map1;
        
        Map<Object, Object> map2 = new HashMap<>();
        map2.put(2,"child2");
        temp.put("child2",map2);
        System.out.println(map);

 

61 dfa 实现敏感词过滤