“婴儿安全岛”设立与取消的思维逻辑



http://www.zhihu.com/people/9Bx59fNH/about

http://www.zhihu.com/people/9Bx59fNH/asks

http://www.zhihu.com/people/9Bx59fNH/answers

http://www.zhihu.com/people/9Bx59fNH/posts

http://www.zhihu.com/people/9Bx59fNH/collections

http://www.zhihu.com/people/9Bx59fNH/logs

http://www.zhihu.com/people/yJ648yXA/about

http://www.zhihu.com/people/yJ648yXA/asks

http://www.zhihu.com/people/yJ648yXA/answers

http://www.zhihu.com/people/yJ648yXA/posts

http://www.zhihu.com/people/yJ648yXA/collections

http://www.zhihu.com/people/yJ648yXA/logs

http://www.zhihu.com/people/F9dlZh73/about

http://www.zhihu.com/people/F9dlZh73/asks

http://www.zhihu.com/people/F9dlZh73/answers

http://www.zhihu.com/people/F9dlZh73/posts

http://www.zhihu.com/people/F9dlZh73/collections

http://www.zhihu.com/people/F9dlZh73/logs

http://www.zhihu.com/people/xqMaGqXh/about

http://www.zhihu.com/people/xqMaGqXh/asks

http://www.zhihu.com/people/xqMaGqXh/answers

http://www.zhihu.com/people/xqMaGqXh/posts

http://www.zhihu.com/people/xqMaGqXh/collections

http://www.zhihu.com/people/xqMaGqXh/logs

http://www.zhihu.com/people/k7SVNnTa/about

http://www.zhihu.com/people/k7SVNnTa/asks

http://www.zhihu.com/people/k7SVNnTa/answers

http://www.zhihu.com/people/k7SVNnTa/posts

http://www.zhihu.com/people/k7SVNnTa/collections

http://www.zhihu.com/people/k7SVNnTa/logs

http://www.zhihu.com/people/wcW4ojPU/about

http://www.zhihu.com/people/wcW4ojPU/asks

http://www.zhihu.com/people/wcW4ojPU/answers

http://www.zhihu.com/people/wcW4ojPU/posts

http://www.zhihu.com/people/wcW4ojPU/collections

http://www.zhihu.com/people/wcW4ojPU/logs

http://www.zhihu.com/people/9JP5hDf3/about

http://www.zhihu.com/people/9JP5hDf3/asks

http://www.zhihu.com/people/9JP5hDf3/answers

http://www.zhihu.com/people/9JP5hDf3/posts

http://www.zhihu.com/people/9JP5hDf3/collections

http://www.zhihu.com/people/9JP5hDf3/logs

http://www.zhihu.com/people/6D1vAT04/about

http://www.zhihu.com/people/6D1vAT04/asks

http://www.zhihu.com/people/6D1vAT04/answers

http://www.zhihu.com/people/6D1vAT04/posts

http://www.zhihu.com/people/6D1vAT04/collections

http://www.zhihu.com/people/6D1vAT04/logs

http://www.zhihu.com/people/pRHJTpTr/about

http://www.zhihu.com/people/pRHJTpTr/asks

http://www.zhihu.com/people/pRHJTpTr/answers

http://www.zhihu.com/people/pRHJTpTr/posts

http://www.zhihu.com/people/pRHJTpTr/collections

http://www.zhihu.com/people/pRHJTpTr/logs

http://www.zhihu.com/people/Xlv9117n/about

http://www.zhihu.com/people/Xlv9117n/asks

http://www.zhihu.com/people/Xlv9117n/answers

http://www.zhihu.com/people/Xlv9117n/posts

http://www.zhihu.com/people/Xlv9117n/collections

http://www.zhihu.com/people/Xlv9117n/logs

http://www.zhihu.com/people/z59iiR0B/about

http://www.zhihu.com/people/z59iiR0B/asks

http://www.zhihu.com/people/z59iiR0B/answers

http://www.zhihu.com/people/z59iiR0B/posts

http://www.zhihu.com/people/z59iiR0B/collections

http://www.zhihu.com/people/z59iiR0B/logs

http://www.zhihu.com/people/rFvj1p16/about

http://www.zhihu.com/people/rFvj1p16/asks

http://www.zhihu.com/people/rFvj1p16/answers

http://www.zhihu.com/people/rFvj1p16/posts

http://www.zhihu.com/people/rFvj1p16/collections

http://www.zhihu.com/people/rFvj1p16/logs

http://www.zhihu.com/people/T53N97fN/about

http://www.zhihu.com/people/T53N97fN/asks

http://www.zhihu.com/people/T53N97fN/answers

http://www.zhihu.com/people/T53N97fN/posts

http://www.zhihu.com/people/T53N97fN/collections

http://www.zhihu.com/people/T53N97fN/logs

http://www.zhihu.com/people/BJn9O65f/about

http://www.zhihu.com/people/BJn9O65f/asks

http://www.zhihu.com/people/BJn9O65f/answers

http://www.zhihu.com/people/BJn9O65f/posts

http://www.zhihu.com/people/BJn9O65f/collections

http://www.zhihu.com/people/BJn9O65f/logs

http://www.zhihu.com/people/XKw58gcP/about

http://www.zhihu.com/people/XKw58gcP/asks

http://www.zhihu.com/people/XKw58gcP/answers

http://www.zhihu.com/people/XKw58gcP/posts

http://www.zhihu.com/people/XKw58gcP/collections

http://www.zhihu.com/people/XKw58gcP/logs

http://www.zhihu.com/people/L2vLakQ7/about

http://www.zhihu.com/people/L2vLakQ7/asks

http://www.zhihu.com/people/L2vLakQ7/answers

http://www.zhihu.com/people/L2vLakQ7/posts

http://www.zhihu.com/people/L2vLakQ7/collections

http://www.zhihu.com/people/L2vLakQ7/logs

http://www.zhihu.com/people/rJ1tVSSn/about

http://www.zhihu.com/people/rJ1tVSSn/asks

http://www.zhihu.com/people/rJ1tVSSn/answers

http://www.zhihu.com/people/rJ1tVSSn/posts

http://www.zhihu.com/people/rJ1tVSSn/collections

http://www.zhihu.com/people/rJ1tVSSn/logs

http://www.zhihu.com/people/9x221J6V/about

http://www.zhihu.com/people/9x221J6V/asks

http://www.zhihu.com/people/9x221J6V/answers

http://www.zhihu.com/people/9x221J6V/posts

http://www.zhihu.com/people/9x221J6V/collections

http://www.zhihu.com/people/9x221J6V/logs

http://www.zhihu.com/people/j7Xnhz71/about

http://www.zhihu.com/people/j7Xnhz71/asks

http://www.zhihu.com/people/j7Xnhz71/answers

http://www.zhihu.com/people/j7Xnhz71/posts

http://www.zhihu.com/people/j7Xnhz71/collections

http://www.zhihu.com/people/j7Xnhz71/logs

http://www.zhihu.com/people/rNhz15Rx/about

http://www.zhihu.com/people/rNhz15Rx/asks

http://www.zhihu.com/people/rNhz15Rx/answers

http://www.zhihu.com/people/rNhz15Rx/posts

http://www.zhihu.com/people/rNhz15Rx/collections

http://www.zhihu.com/people/rNhz15Rx/logs

http://www.zhihu.com/people/4zq5085L/about

http://www.zhihu.com/people/4zq5085L/asks

http://www.zhihu.com/people/4zq5085L/answers

http://www.zhihu.com/people/4zq5085L/posts

http://www.zhihu.com/people/4zq5085L/collections

http://www.zhihu.com/people/4zq5085L/logs

http://www.zhihu.com/people/aA4nUlkr/about

http://www.zhihu.com/people/aA4nUlkr/asks

http://www.zhihu.com/people/aA4nUlkr/answers

http://www.zhihu.com/people/aA4nUlkr/posts

http://www.zhihu.com/people/aA4nUlkr/collections

http://www.zhihu.com/people/aA4nUlkr/logs

http://www.zhihu.com/people/XP7R9JP3/about

http://www.zhihu.com/people/XP7R9JP3/asks

http://www.zhihu.com/people/XP7R9JP3/answers

http://www.zhihu.com/people/XP7R9JP3/posts

http://www.zhihu.com/people/XP7R9JP3/collections

http://www.zhihu.com/people/XP7R9JP3/logs

http://www.zhihu.com/people/88pPT1n3/about

http://www.zhihu.com/people/88pPT1n3/asks

http://www.zhihu.com/people/88pPT1n3/answers

http://www.zhihu.com/people/88pPT1n3/posts

http://www.zhihu.com/people/88pPT1n3/collections

http://www.zhihu.com/people/88pPT1n3/logs

http://www.zhihu.com/people/YnQ1jvTZ/about

http://www.zhihu.com/people/YnQ1jvTZ/asks

http://www.zhihu.com/people/YnQ1jvTZ/answers

http://www.zhihu.com/people/YnQ1jvTZ/posts

http://www.zhihu.com/people/YnQ1jvTZ/collections

http://www.zhihu.com/people/YnQ1jvTZ/logs

http://www.zhihu.com/people/19051EY5/about

http://www.zhihu.com/people/19051EY5/asks

http://www.zhihu.com/people/19051EY5/answers

http://www.zhihu.com/people/19051EY5/posts

http://www.zhihu.com/people/19051EY5/collections

http://www.zhihu.com/people/19051EY5/logs

http://www.zhihu.com/people/v5k2P4BZ/about

http://www.zhihu.com/people/v5k2P4BZ/asks

http://www.zhihu.com/people/v5k2P4BZ/answers

http://www.zhihu.com/people/v5k2P4BZ/posts

http://www.zhihu.com/people/v5k2P4BZ/collections

http://www.zhihu.com/people/v5k2P4BZ/logs

http://www.zhihu.com/people/G2iNF6ST/about

http://www.zhihu.com/people/G2iNF6ST/asks

http://www.zhihu.com/people/G2iNF6ST/answers

http://www.zhihu.com/people/G2iNF6ST/posts

http://www.zhihu.com/people/G2iNF6ST/collections

http://www.zhihu.com/people/G2iNF6ST/logs

http://www.zhihu.com/people/WgCpLYN1/about

http://www.zhihu.com/people/WgCpLYN1/asks

http://www.zhihu.com/people/WgCpLYN1/answers

http://www.zhihu.com/people/WgCpLYN1/posts

http://www.zhihu.com/people/WgCpLYN1/collections

http://www.zhihu.com/people/WgCpLYN1/logs

http://www.zhihu.com/people/33Q356Y4/about

http://www.zhihu.com/people/33Q356Y4/asks

http://www.zhihu.com/people/33Q356Y4/answers

http://www.zhihu.com/people/33Q356Y4/posts

http://www.zhihu.com/people/33Q356Y4/collections

http://www.zhihu.com/people/33Q356Y4/logs

http://www.zhihu.com/people/jYXwX56B/about

http://www.zhihu.com/people/jYXwX56B/asks

http://www.zhihu.com/people/jYXwX56B/answers

http://www.zhihu.com/people/jYXwX56B/posts

http://www.zhihu.com/people/jYXwX56B/collections

http://www.zhihu.com/people/jYXwX56B/logs

http://www.zhihu.com/people/3rxL13Z3/about

http://www.zhihu.com/people/3rxL13Z3/asks

http://www.zhihu.com/people/3rxL13Z3/answers

http://www.zhihu.com/people/3rxL13Z3/posts

http://www.zhihu.com/people/3rxL13Z3/collections

http://www.zhihu.com/people/3rxL13Z3/logs

http://www.zhihu.com/people/yMCIp166/about

http://www.zhihu.com/people/yMCIp166/asks

http://www.zhihu.com/people/yMCIp166/answers

http://www.zhihu.com/people/yMCIp166/posts

http://www.zhihu.com/people/yMCIp166/collections

http://www.zhihu.com/people/yMCIp166/logs

http://www.zhihu.com/people/3gB9887R/about

http://www.zhihu.com/people/3gB9887R/asks

http://www.zhihu.com/people/3gB9887R/answers

http://www.zhihu.com/people/3gB9887R/posts

http://www.zhihu.com/people/3gB9887R/collections

http://www.zhihu.com/people/3gB9887R/logs

http://www.zhihu.com/people/V3dj00yg/about

http://www.zhihu.com/people/V3dj00yg/asks

http://www.zhihu.com/people/V3dj00yg/answers

http://www.zhihu.com/people/V3dj00yg/posts

http://www.zhihu.com/people/V3dj00yg/collections

http://www.zhihu.com/people/V3dj00yg/logs

http://www.zhihu.com/people/BzW2252J/about

http://www.zhihu.com/people/BzW2252J/asks

http://www.zhihu.com/people/BzW2252J/answers

http://www.zhihu.com/people/BzW2252J/posts

http://www.zhihu.com/people/BzW2252J/collections

http://www.zhihu.com/people/BzW2252J/logs

http://www.zhihu.com/people/83dRSZjG/about

http://www.zhihu.com/people/83dRSZjG/asks

http://www.zhihu.com/people/83dRSZjG/answers

http://www.zhihu.com/people/83dRSZjG/posts

http://www.zhihu.com/people/83dRSZjG/collections

http://www.zhihu.com/people/83dRSZjG/logs

http://www.zhihu.com/people/vHt6Y0uo/about

http://www.zhihu.com/people/vHt6Y0uo/asks

http://www.zhihu.com/people/vHt6Y0uo/answers

http://www.zhihu.com/people/vHt6Y0uo/posts

http://www.zhihu.com/people/vHt6Y0uo/collections

http://www.zhihu.com/people/vHt6Y0uo/logs

http://www.zhihu.com/people/nzxnv249/about

http://www.zhihu.com/people/nzxnv249/asks

http://www.zhihu.com/people/nzxnv249/answers

http://www.zhihu.com/people/nzxnv249/posts

http://www.zhihu.com/people/nzxnv249/collections

http://www.zhihu.com/people/nzxnv249/logs

http://www.zhihu.com/people/5PBZHh5N/about

http://www.zhihu.com/people/5PBZHh5N/asks

http://www.zhihu.com/people/5PBZHh5N/answers

http://www.zhihu.com/people/5PBZHh5N/posts

http://www.zhihu.com/people/5PBZHh5N/collections

http://www.zhihu.com/people/5PBZHh5N/logs

http://www.zhihu.com/people/m8WEa8ge/about

http://www.zhihu.com/people/m8WEa8ge/asks

http://www.zhihu.com/people/m8WEa8ge/answers

http://www.zhihu.com/people/m8WEa8ge/posts

http://www.zhihu.com/people/m8WEa8ge/collections

http://www.zhihu.com/people/m8WEa8ge/logs

http://www.zhihu.com/people/dzzPhBJT/about

http://www.zhihu.com/people/dzzPhBJT/asks

http://www.zhihu.com/people/dzzPhBJT/answers

http://www.zhihu.com/people/dzzPhBJT/posts

http://www.zhihu.com/people/dzzPhBJT/collections

http://www.zhihu.com/people/dzzPhBJT/logs

http://www.zhihu.com/people/p6WXhruY/about

http://www.zhihu.com/people/p6WXhruY/asks

http://www.zhihu.com/people/p6WXhruY/answers

http://www.zhihu.com/people/p6WXhruY/posts

http://www.zhihu.com/people/p6WXhruY/collections

http://www.zhihu.com/people/p6WXhruY/logs

http://www.zhihu.com/people/6hD61ibq/about

http://www.zhihu.com/people/6hD61ibq/asks

http://www.zhihu.com/people/6hD61ibq/answers

http://www.zhihu.com/people/6hD61ibq/posts

http://www.zhihu.com/people/6hD61ibq/collections

http://www.zhihu.com/people/6hD61ibq/logs

http://www.zhihu.com/people/Pn7b1nv5/about

http://www.zhihu.com/people/Pn7b1nv5/asks

http://www.zhihu.com/people/Pn7b1nv5/answers

http://www.zhihu.com/people/Pn7b1nv5/posts

http://www.zhihu.com/people/Pn7b1nv5/collections

http://www.zhihu.com/people/Pn7b1nv5/logs

http://www.zhihu.com/people/r8mWWHO3/about

http://www.zhihu.com/people/r8mWWHO3/asks

http://www.zhihu.com/people/r8mWWHO3/answers

http://www.zhihu.com/people/r8mWWHO3/posts

http://www.zhihu.com/people/r8mWWHO3/collections

http://www.zhihu.com/people/r8mWWHO3/logs

http://www.zhihu.com/people/6jyyNNnG/about

http://www.zhihu.com/people/6jyyNNnG/asks

http://www.zhihu.com/people/6jyyNNnG/answers

http://www.zhihu.com/people/6jyyNNnG/posts

http://www.zhihu.com/people/6jyyNNnG/collections

http://www.zhihu.com/people/6jyyNNnG/logs

http://www.zhihu.com/people/7F357Xfz/about

http://www.zhihu.com/people/7F357Xfz/asks

http://www.zhihu.com/people/7F357Xfz/answers

http://www.zhihu.com/people/7F357Xfz/posts

http://www.zhihu.com/people/7F357Xfz/collections

http://www.zhihu.com/people/7F357Xfz/logs

http://www.zhihu.com/people/dj1V7Z1l/about

http://www.zhihu.com/people/dj1V7Z1l/asks

http://www.zhihu.com/people/dj1V7Z1l/answers

http://www.zhihu.com/people/dj1V7Z1l/posts

http://www.zhihu.com/people/dj1V7Z1l/collections

http://www.zhihu.com/people/dj1V7Z1l/logs

http://www.zhihu.com/people/n3Tl9vd7/about

http://www.zhihu.com/people/n3Tl9vd7/asks

http://www.zhihu.com/people/n3Tl9vd7/answers

http://www.zhihu.com/people/n3Tl9vd7/posts

http://www.zhihu.com/people/n3Tl9vd7/collections

http://www.zhihu.com/people/n3Tl9vd7/logs

http://www.zhihu.com/people/5eR3tpFr/about

http://www.zhihu.com/people/5eR3tpFr/asks

http://www.zhihu.com/people/5eR3tpFr/answers

http://www.zhihu.com/people/5eR3tpFr/posts

http://www.zhihu.com/people/5eR3tpFr/collections

http://www.zhihu.com/people/5eR3tpFr/logs

http://www.zhihu.com/people/977NxBlJ/about

http://www.zhihu.com/people/977NxBlJ/asks

http://www.zhihu.com/people/977NxBlJ/answers

http://www.zhihu.com/people/977NxBlJ/posts

http://www.zhihu.com/people/977NxBlJ/collections

http://www.zhihu.com/people/977NxBlJ/logs

http://www.zhihu.com/people/ZNjDhp35/about

http://www.zhihu.com/people/ZNjDhp35/asks

http://www.zhihu.com/people/ZNjDhp35/answers

http://www.zhihu.com/people/ZNjDhp35/posts

http://www.zhihu.com/people/ZNjDhp35/collections

http://www.zhihu.com/people/ZNjDhp35/logs

http://www.zhihu.com/people/tDf931rr/about

http://www.zhihu.com/people/tDf931rr/asks

http://www.zhihu.com/people/tDf931rr/answers

http://www.zhihu.com/people/tDf931rr/posts

http://www.zhihu.com/people/tDf931rr/collections

http://www.zhihu.com/people/tDf931rr/logs

http://www.zhihu.com/people/D10S93E3/about

http://www.zhihu.com/people/D10S93E3/asks

http://www.zhihu.com/people/D10S93E3/answers

http://www.zhihu.com/people/D10S93E3/posts

http://www.zhihu.com/people/D10S93E3/collections

http://www.zhihu.com/people/D10S93E3/logs

http://www.zhihu.com/people/dA8JGWTy/about

http://www.zhihu.com/people/dA8JGWTy/asks

http://www.zhihu.com/people/dA8JGWTy/answers

http://www.zhihu.com/people/dA8JGWTy/posts

http://www.zhihu.com/people/dA8JGWTy/collections

http://www.zhihu.com/people/dA8JGWTy/logs

http://www.zhihu.com/people/9Rb3x9JH/about

http://www.zhihu.com/people/9Rb3x9JH/asks

http://www.zhihu.com/people/9Rb3x9JH/answers

http://www.zhihu.com/people/9Rb3x9JH/posts

http://www.zhihu.com/people/9Rb3x9JH/collections

http://www.zhihu.com/people/9Rb3x9JH/logs

http://www.zhihu.com/people/nGjY5aJC/about

http://www.zhihu.com/people/nGjY5aJC/asks

http://www.zhihu.com/people/nGjY5aJC/answers

http://www.zhihu.com/people/nGjY5aJC/posts

http://www.zhihu.com/people/nGjY5aJC/collections

http://www.zhihu.com/people/nGjY5aJC/logs

http://www.zhihu.com/people/w2JV74uw/about

http://www.zhihu.com/people/w2JV74uw/asks

http://www.zhihu.com/people/w2JV74uw/answers

http://www.zhihu.com/people/w2JV74uw/posts

http://www.zhihu.com/people/w2JV74uw/collections

http://www.zhihu.com/people/w2JV74uw/logs

http://www.zhihu.com/people/Rxh8Qe9U/about

http://www.zhihu.com/people/Rxh8Qe9U/asks

http://www.zhihu.com/people/Rxh8Qe9U/answers

http://www.zhihu.com/people/Rxh8Qe9U/posts

http://www.zhihu.com/people/Rxh8Qe9U/collections

http://www.zhihu.com/people/Rxh8Qe9U/logs

http://www.zhihu.com/people/V58H7BpH/about

http://www.zhihu.com/people/V58H7BpH/asks

http://www.zhihu.com/people/V58H7BpH/answers

http://www.zhihu.com/people/V58H7BpH/posts

http://www.zhihu.com/people/V58H7BpH/collections

http://www.zhihu.com/people/V58H7BpH/logs

http://www.zhihu.com/people/9NB5XE5z/about

http://www.zhihu.com/people/9NB5XE5z/asks

http://www.zhihu.com/people/9NB5XE5z/answers

http://www.zhihu.com/people/9NB5XE5z/posts

http://www.zhihu.com/people/9NB5XE5z/collections

http://www.zhihu.com/people/9NB5XE5z/logs

http://www.zhihu.com/people/91NHf9jl/about

http://www.zhihu.com/people/91NHf9jl/asks

http://www.zhihu.com/people/91NHf9jl/answers

http://www.zhihu.com/people/91NHf9jl/posts

http://www.zhihu.com/people/91NHf9jl/collections

http://www.zhihu.com/people/91NHf9jl/logs

http://www.zhihu.com/people/0t4neC4b/about

http://www.zhihu.com/people/0t4neC4b/asks

http://www.zhihu.com/people/0t4neC4b/answers

http://www.zhihu.com/people/0t4neC4b/posts

http://www.zhihu.com/people/0t4neC4b/collections

http://www.zhihu.com/people/0t4neC4b/logs

时间: 2024-09-29 21:14:39

“婴儿安全岛”设立与取消的思维逻辑的相关文章

计算机程序的思维逻辑 (22) - 代码的组织机制

使用任何语言进行编程都有一个类似的问题,那就是如何组织代码,具体来说,如何避免命名冲突?如何合理组织各种源文件?如何使用第三方库?各种代码和依赖库如何编译连接为一个完整的程序? 本节就来讨论Java中的解决机制,具体包括包.jar包.程序的编译与连接,从包开始. 包的概念 使用任何语言进行编程都有一个相同的问题,就是命名冲突,程序一般不全是一个人写的,会调用系统提供的代码.第三方库中的代码.项目中其他人写的代码等,不同的人就不同的目的可能定义同样的类名/接口名,Java中解决这个问题的方法就是包

计算机程序的思维逻辑 (23) - 枚举的本质

前面系列,我们介绍了Java中表示和操作数据的基本数据类型.类和接口,本节探讨Java中的枚举类型. 所谓枚举,是一种特殊的数据,它的取值是有限的,可以枚举出来的,比如说一年就是有四季.一周有七天,虽然使用类也可以处理这种数据,但枚举类型更为简洁.安全和方便. 下面我们就来介绍枚举的使用,同时介绍其实现原理. 基础 基本用法 定义和使用基本的枚举是比较简单的,我们来看个例子,为表示衣服的尺寸,我们定义一个枚举类型Size,包括三个尺寸,小/中/大,代码如下: public enum Size {

计算机程序的思维逻辑 (21) - 内部类的本质

内部类 之前我们所说的类都对应于一个独立的Java源文件,但一个类还可以放在另一个类的内部,称之为内部类,相对而言,包含它的类称之为外部类. 为什么要放到别的类内部呢?一般而言,内部类与包含它的外部类有比较密切的关系,而与其他类关系不大,定义在类内部,可以实现对外部完全隐藏,可以有更好的封装性,代码实现上也往往更为简洁. 不过,内部类只是Java编译器的概念,对于Java虚拟机而言,它是不知道内部类这回事的, 每个内部类最后都会被编译为一个独立的类,生成一个独立的字节码文件. 也就是说,每个内部

计算机程序的思维逻辑 (29) - 剖析String

上节介绍了单个字符的封装类Character,本节介绍字符串类.字符串操作大概是计算机程序中最常见的操作了,Java中表示字符串的类是String,本节就来详细介绍String. 字符串的基本使用是比较简单直接的,我们来看下. 基本用法 可以通过常量定义String变量 String name = "老马说编程"; 也可以通过new创建String String name = new String("老马说编程"); String可以直接使用+和+=运算符,如: S

计算机程序的思维逻辑 (28) - 剖析包装类 (下)

本节探讨Character类,它的基本用法我们在包装类第一节已经介绍了,本节不再赘述.Character类除了封装了一个char外,还有什么可介绍的呢?它有很多静态方法,封装了Unicode字符级别的各种操作,是Java文本处理的基础,注意不是char级别,Unicode字符并不等同于char,本节详细介绍这些方法以及相关的Unicode知识. 在介绍这些方法之前,我们需要回顾一下字符在Java中的表示方法,我们在第六节.第七节.第八节介绍过编码.Unicode.char等知识,我们先简要回顾一

计算机程序的思维逻辑 (25) - 异常 (下)

上节我们介绍了异常的基本概念和异常类,本节我们进一步介绍对异常的处理,我们先来看Java语言对异常处理的支持,然后探讨在实际中到底应该如何处理异常. 异常处理 catch匹配 上节简单介绍了使用try/catch捕获异常,其中catch只有一条,其实,catch还可以有多条,每条对应一个异常类型,比如说: try{ //可能触发异常的代码 }catch(NumberFormatException e){ System.out.println("not valid number"); }

计算机程序的思维逻辑 (83) - 并发总结

从65节到82节,我们用了18篇文章讨论并发,本节进行简要总结. 多线程开发有两个核心问题,一个是竞争,另一个是协作.竞争会出现线程安全问题,所以,本节首先总结线程安全的机制,然后是协作的机制.管理竞争和协作是复杂的,所以Java提供了更高层次的服务,比如并发容器类和异步任务执行服务,我们也会进行总结.本节纲要如下: 线程安全的机制 线程的协作机制 容器类 任务执行服务 线程安全的机制 线程表示一条单独的执行流,每个线程有自己的执行计数器,有自己的栈,但可以共享内存,共享内存是实现线程协作的基础

计算机程序的思维逻辑 (56) - 文件概述

我们在日常电脑操作中,接触和处理最多的,除了上网,大概就是各种各样的文件了,从本节开始,我们就来探讨文件处理,本节主要介绍文件有关的一些基本概念和常识,Java中处理文件的基本思路和类结构,以及接来下章节的安排思路. 基本概念和常识 二进制思维 为了透彻理解文件,我们首先要有一个二进制思维.所有文件,不论是可执行文件.图片文件.视频文件.Word文件.压缩文件.txt文件,都没什么可神秘的,它们都是以0和1的二进制形式保存的.我们所看到的图片.视频.文本,都是应用程序对这些二进制的解析结果. 作

计算机程序的思维逻辑 (53) - 剖析Collections - 算法

之前几节介绍了各种具体容器类和抽象容器类,上节我们提到,Java中有一个类Collections,提供了很多针对容器接口的通用功能,这些功能都是以静态方法的方式提供的. 都有哪些功能呢?大概可以分为两类: 对容器接口对象进行操作 返回一个容器接口对象 对于第一类,操作大概可以分为三组: 查找和替换 排序和调整顺序 添加和修改 对于第二类,大概可以分为两组: 适配器:将其他类型的数据转换为容器接口对象 装饰器:修饰一个给定容器接口对象,增加某种性质 它们都是围绕容器接口对象的,第一类是针对容器接口