diff --git a/JavaSE/bin/liucong/JavaSe(Liucong).zip b/JavaSE/bin/liucong/JavaSe(Liucong).zip new file mode 100644 index 0000000..4c4ae26 Binary files /dev/null and b/JavaSE/bin/liucong/JavaSe(Liucong).zip differ diff --git a/JavaSE/bin/mine/eight/random/Random.class b/JavaSE/bin/mine/eight/random/Random.class new file mode 100644 index 0000000..656298d Binary files /dev/null and b/JavaSE/bin/mine/eight/random/Random.class differ diff --git a/JavaSE/bin/mine/eleven/staticdemo/StaticDemo.class b/JavaSE/bin/mine/eleven/staticdemo/StaticDemo.class new file mode 100644 index 0000000..6c7a482 Binary files /dev/null and b/JavaSE/bin/mine/eleven/staticdemo/StaticDemo.class differ diff --git a/JavaSE/bin/mine/fifteen/zhihuan/ZhiHuan.class b/JavaSE/bin/mine/fifteen/zhihuan/ZhiHuan.class new file mode 100644 index 0000000..2a9be74 Binary files /dev/null and b/JavaSE/bin/mine/fifteen/zhihuan/ZhiHuan.class differ diff --git a/JavaSE/bin/mine/five/shopping/Shopping.class b/JavaSE/bin/mine/five/shopping/Shopping.class new file mode 100644 index 0000000..08829dc Binary files /dev/null and b/JavaSE/bin/mine/five/shopping/Shopping.class differ diff --git a/JavaSE/bin/mine/four/houchitao/HouZiChiTao.class b/JavaSE/bin/mine/four/houchitao/HouZiChiTao.class new file mode 100644 index 0000000..390d7b5 Binary files /dev/null and b/JavaSE/bin/mine/four/houchitao/HouZiChiTao.class differ diff --git a/JavaSE/bin/mine/fourteen/zimu/ZiMu.class b/JavaSE/bin/mine/fourteen/zimu/ZiMu.class new file mode 100644 index 0000000..49f1759 Binary files /dev/null and b/JavaSE/bin/mine/fourteen/zimu/ZiMu.class differ diff --git a/JavaSE/bin/mine/nine/tianshu/TianShu.class b/JavaSE/bin/mine/nine/tianshu/TianShu.class new file mode 100644 index 0000000..217735f Binary files /dev/null and b/JavaSE/bin/mine/nine/tianshu/TianShu.class differ diff --git a/JavaSE/bin/mine/one/pingrunnian/PingRunNian.class b/JavaSE/bin/mine/one/pingrunnian/PingRunNian.class new file mode 100644 index 0000000..546f8ec Binary files /dev/null and b/JavaSE/bin/mine/one/pingrunnian/PingRunNian.class differ diff --git a/JavaSE/bin/mine/seven/login/Login.class b/JavaSE/bin/mine/seven/login/Login.class new file mode 100644 index 0000000..12f854c Binary files /dev/null and b/JavaSE/bin/mine/seven/login/Login.class differ diff --git a/JavaSE/bin/mine/sixteen/kexuexianshi/KeXueXianShi.class b/JavaSE/bin/mine/sixteen/kexuexianshi/KeXueXianShi.class new file mode 100644 index 0000000..f2ca956 Binary files /dev/null and b/JavaSE/bin/mine/sixteen/kexuexianshi/KeXueXianShi.class differ diff --git a/JavaSE/bin/mine/ten/fengzhuang/FengZhuang.class b/JavaSE/bin/mine/ten/fengzhuang/FengZhuang.class new file mode 100644 index 0000000..f8f3791 Binary files /dev/null and b/JavaSE/bin/mine/ten/fengzhuang/FengZhuang.class differ diff --git a/JavaSE/bin/mine/thirty/CollectionAndMap/list/ListDemo.class b/JavaSE/bin/mine/thirty/CollectionAndMap/list/ListDemo.class new file mode 100644 index 0000000..d8fb8cc Binary files /dev/null and b/JavaSE/bin/mine/thirty/CollectionAndMap/list/ListDemo.class differ diff --git a/JavaSE/bin/mine/thirty/CollectionAndMap/set/setDemo.class b/JavaSE/bin/mine/thirty/CollectionAndMap/set/setDemo.class new file mode 100644 index 0000000..b111950 Binary files /dev/null and b/JavaSE/bin/mine/thirty/CollectionAndMap/set/setDemo.class differ diff --git a/JavaSE/bin/mine/thirty/CollectionAndMap/summary/ArrayListDemo.class b/JavaSE/bin/mine/thirty/CollectionAndMap/summary/ArrayListDemo.class new file mode 100644 index 0000000..d74f7b9 Binary files /dev/null and b/JavaSE/bin/mine/thirty/CollectionAndMap/summary/ArrayListDemo.class differ diff --git a/JavaSE/bin/mine/thirty/CollectionAndMap/summary/HashMapDemo.class b/JavaSE/bin/mine/thirty/CollectionAndMap/summary/HashMapDemo.class new file mode 100644 index 0000000..470d418 Binary files /dev/null and b/JavaSE/bin/mine/thirty/CollectionAndMap/summary/HashMapDemo.class differ diff --git a/JavaSE/bin/mine/thirty/CollectionAndMap/summary/HashSetDemo.class b/JavaSE/bin/mine/thirty/CollectionAndMap/summary/HashSetDemo.class new file mode 100644 index 0000000..9ed8bb2 Binary files /dev/null and b/JavaSE/bin/mine/thirty/CollectionAndMap/summary/HashSetDemo.class differ diff --git a/JavaSE/bin/mine/thirty/CollectionAndMap/summary/LinkedListDemo.class b/JavaSE/bin/mine/thirty/CollectionAndMap/summary/LinkedListDemo.class new file mode 100644 index 0000000..e590716 Binary files /dev/null and b/JavaSE/bin/mine/thirty/CollectionAndMap/summary/LinkedListDemo.class differ diff --git a/JavaSE/bin/mine/thirtyFive/StringInteger/Demo.class b/JavaSE/bin/mine/thirtyFive/StringInteger/Demo.class new file mode 100644 index 0000000..b416dbc Binary files /dev/null and b/JavaSE/bin/mine/thirtyFive/StringInteger/Demo.class differ diff --git a/JavaSE/bin/mine/thirtyFive/StringInteger/Test.class b/JavaSE/bin/mine/thirtyFive/StringInteger/Test.class new file mode 100644 index 0000000..e1d01f1 Binary files /dev/null and b/JavaSE/bin/mine/thirtyFive/StringInteger/Test.class differ diff --git a/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question1.class b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question1.class new file mode 100644 index 0000000..d285cf6 Binary files /dev/null and b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question1.class differ diff --git a/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question2.class b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question2.class new file mode 100644 index 0000000..3412c89 Binary files /dev/null and b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question2.class differ diff --git a/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question3.class b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question3.class new file mode 100644 index 0000000..b2637b5 Binary files /dev/null and b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question3.class differ diff --git a/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question4.class b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question4.class new file mode 100644 index 0000000..fb9f6da Binary files /dev/null and b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question4.class differ diff --git a/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question5.class b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question5.class new file mode 100644 index 0000000..3a72d12 Binary files /dev/null and b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question5.class differ diff --git a/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question6and7.class b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question6and7.class new file mode 100644 index 0000000..fc22901 Binary files /dev/null and b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question6and7.class differ diff --git a/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question8.class b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question8.class new file mode 100644 index 0000000..1b6ca4c Binary files /dev/null and b/JavaSE/bin/mine/thirtyFour/StringBufferCollection/Question8.class differ diff --git a/JavaSE/bin/mine/thirtyOne/ExceptionDemo/basic/qb178_01/Demo.class b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/basic/qb178_01/Demo.class new file mode 100644 index 0000000..ac4421d Binary files /dev/null and b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/basic/qb178_01/Demo.class differ diff --git a/JavaSE/bin/mine/thirtyOne/ExceptionDemo/basic/qb178_02/Demo.class b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/basic/qb178_02/Demo.class new file mode 100644 index 0000000..c139d4c Binary files /dev/null and b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/basic/qb178_02/Demo.class differ diff --git a/JavaSE/bin/mine/thirtyOne/ExceptionDemo/basic/qb178_03/Demo.class b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/basic/qb178_03/Demo.class new file mode 100644 index 0000000..e1caa58 Binary files /dev/null and b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/basic/qb178_03/Demo.class differ diff --git a/JavaSE/bin/mine/thirtyOne/ExceptionDemo/project/Project02/Demo.class b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/project/Project02/Demo.class new file mode 100644 index 0000000..3047368 Binary files /dev/null and b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/project/Project02/Demo.class differ diff --git a/JavaSE/bin/mine/thirtyOne/ExceptionDemo/project/Project02/Myself.class b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/project/Project02/Myself.class new file mode 100644 index 0000000..1352d3e Binary files /dev/null and b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/project/Project02/Myself.class differ diff --git a/JavaSE/bin/mine/thirtyOne/ExceptionDemo/project/Project02/NotZeroException.class b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/project/Project02/NotZeroException.class new file mode 100644 index 0000000..2811914 Binary files /dev/null and b/JavaSE/bin/mine/thirtyOne/ExceptionDemo/project/Project02/NotZeroException.class differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/imgs/airplane.jpg b/JavaSE/bin/mine/thirtySeven/airplane/imgs/airplane.jpg new file mode 100644 index 0000000..9ec7d72 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/imgs/airplane.jpg differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/imgs/background.jpg b/JavaSE/bin/mine/thirtySeven/airplane/imgs/background.jpg new file mode 100644 index 0000000..96bb3a7 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/imgs/background.jpg differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/imgs/bee.jpg b/JavaSE/bin/mine/thirtySeven/airplane/imgs/bee.jpg new file mode 100644 index 0000000..e746264 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/imgs/bee.jpg differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/imgs/bullet.jpg b/JavaSE/bin/mine/thirtySeven/airplane/imgs/bullet.jpg new file mode 100644 index 0000000..88ace59 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/imgs/bullet.jpg differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/imgs/gameover.jpg b/JavaSE/bin/mine/thirtySeven/airplane/imgs/gameover.jpg new file mode 100644 index 0000000..47a88e5 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/imgs/gameover.jpg differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/imgs/hero0.jpg b/JavaSE/bin/mine/thirtySeven/airplane/imgs/hero0.jpg new file mode 100644 index 0000000..bbb856f Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/imgs/hero0.jpg differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/imgs/hero1.jpg b/JavaSE/bin/mine/thirtySeven/airplane/imgs/hero1.jpg new file mode 100644 index 0000000..3c2c735 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/imgs/hero1.jpg differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/imgs/icon.jpg b/JavaSE/bin/mine/thirtySeven/airplane/imgs/icon.jpg new file mode 100644 index 0000000..b70413d Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/imgs/icon.jpg differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/imgs/pause.jpg b/JavaSE/bin/mine/thirtySeven/airplane/imgs/pause.jpg new file mode 100644 index 0000000..0655f9d Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/imgs/pause.jpg differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/imgs/start.jpg b/JavaSE/bin/mine/thirtySeven/airplane/imgs/start.jpg new file mode 100644 index 0000000..f7523f3 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/imgs/start.jpg differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/plane/Airplane.class b/JavaSE/bin/mine/thirtySeven/airplane/plane/Airplane.class new file mode 100644 index 0000000..95044ba Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/plane/Airplane.class differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/plane/Award.class b/JavaSE/bin/mine/thirtySeven/airplane/plane/Award.class new file mode 100644 index 0000000..1b34b8c Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/plane/Award.class differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/plane/Bee.class b/JavaSE/bin/mine/thirtySeven/airplane/plane/Bee.class new file mode 100644 index 0000000..a62a4b0 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/plane/Bee.class differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/plane/Bullet.class b/JavaSE/bin/mine/thirtySeven/airplane/plane/Bullet.class new file mode 100644 index 0000000..41ee23b Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/plane/Bullet.class differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/plane/Enemy.class b/JavaSE/bin/mine/thirtySeven/airplane/plane/Enemy.class new file mode 100644 index 0000000..2afe086 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/plane/Enemy.class differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/plane/FlyingObject.class b/JavaSE/bin/mine/thirtySeven/airplane/plane/FlyingObject.class new file mode 100644 index 0000000..3398c2a Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/plane/FlyingObject.class differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/plane/Hero.class b/JavaSE/bin/mine/thirtySeven/airplane/plane/Hero.class new file mode 100644 index 0000000..9f4fe13 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/plane/Hero.class differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/plane/ShootGame$1.class b/JavaSE/bin/mine/thirtySeven/airplane/plane/ShootGame$1.class new file mode 100644 index 0000000..ea83bec Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/plane/ShootGame$1.class differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/plane/ShootGame$2.class b/JavaSE/bin/mine/thirtySeven/airplane/plane/ShootGame$2.class new file mode 100644 index 0000000..f2e2cc3 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/plane/ShootGame$2.class differ diff --git a/JavaSE/bin/mine/thirtySeven/airplane/plane/ShootGame.class b/JavaSE/bin/mine/thirtySeven/airplane/plane/ShootGame.class new file mode 100644 index 0000000..e404ad8 Binary files /dev/null and b/JavaSE/bin/mine/thirtySeven/airplane/plane/ShootGame.class differ diff --git a/JavaSE/bin/mine/thirtySix/UDPandTCP/ClientServer/ClientDemo.class b/JavaSE/bin/mine/thirtySix/UDPandTCP/ClientServer/ClientDemo.class new file mode 100644 index 0000000..de4ee27 Binary files /dev/null and b/JavaSE/bin/mine/thirtySix/UDPandTCP/ClientServer/ClientDemo.class differ diff --git a/JavaSE/bin/mine/thirtySix/UDPandTCP/ClientServer/ServerDemo.class b/JavaSE/bin/mine/thirtySix/UDPandTCP/ClientServer/ServerDemo.class new file mode 100644 index 0000000..8abe3a6 Binary files /dev/null and b/JavaSE/bin/mine/thirtySix/UDPandTCP/ClientServer/ServerDemo.class differ diff --git a/JavaSE/bin/mine/thirtySix/UDPandTCP/InetAddressDemo.class b/JavaSE/bin/mine/thirtySix/UDPandTCP/InetAddressDemo.class new file mode 100644 index 0000000..6a5a2fa Binary files /dev/null and b/JavaSE/bin/mine/thirtySix/UDPandTCP/InetAddressDemo.class differ diff --git a/JavaSE/bin/mine/thirtySix/UDPandTCP/SendReceive/Receive.class b/JavaSE/bin/mine/thirtySix/UDPandTCP/SendReceive/Receive.class new file mode 100644 index 0000000..8f77c05 Binary files /dev/null and b/JavaSE/bin/mine/thirtySix/UDPandTCP/SendReceive/Receive.class differ diff --git a/JavaSE/bin/mine/thirtySix/UDPandTCP/SendReceive/Send.class b/JavaSE/bin/mine/thirtySix/UDPandTCP/SendReceive/Send.class new file mode 100644 index 0000000..129c251 Binary files /dev/null and b/JavaSE/bin/mine/thirtySix/UDPandTCP/SendReceive/Send.class differ diff --git a/JavaSE/bin/mine/thirtySix/UDPandTCP/SendsReceives/Receives.class b/JavaSE/bin/mine/thirtySix/UDPandTCP/SendsReceives/Receives.class new file mode 100644 index 0000000..d270c01 Binary files /dev/null and b/JavaSE/bin/mine/thirtySix/UDPandTCP/SendsReceives/Receives.class differ diff --git a/JavaSE/bin/mine/thirtySix/UDPandTCP/SendsReceives/Sends.class b/JavaSE/bin/mine/thirtySix/UDPandTCP/SendsReceives/Sends.class new file mode 100644 index 0000000..ea86aad Binary files /dev/null and b/JavaSE/bin/mine/thirtySix/UDPandTCP/SendsReceives/Sends.class differ diff --git a/JavaSE/bin/mine/thirtySix/UDPandTCP/SendsReceives/Test1.class b/JavaSE/bin/mine/thirtySix/UDPandTCP/SendsReceives/Test1.class new file mode 100644 index 0000000..b1e8c9a Binary files /dev/null and b/JavaSE/bin/mine/thirtySix/UDPandTCP/SendsReceives/Test1.class differ diff --git a/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm1/RandomCode.class b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm1/RandomCode.class new file mode 100644 index 0000000..23c16c3 Binary files /dev/null and b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm1/RandomCode.class differ diff --git a/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm1/RandomCodeTest.class b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm1/RandomCodeTest.class new file mode 100644 index 0000000..bdc966d Binary files /dev/null and b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm1/RandomCodeTest.class differ diff --git a/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm2/Email.class b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm2/Email.class new file mode 100644 index 0000000..733471f Binary files /dev/null and b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm2/Email.class differ diff --git a/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm2/EmailTest.class b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm2/EmailTest.class new file mode 100644 index 0000000..07ba6ec Binary files /dev/null and b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm2/EmailTest.class differ diff --git a/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm3/CountTest.class b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm3/CountTest.class new file mode 100644 index 0000000..ec34e9d Binary files /dev/null and b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm3/CountTest.class differ diff --git a/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm3/GCount.class b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm3/GCount.class new file mode 100644 index 0000000..c1a7b52 Binary files /dev/null and b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm3/GCount.class differ diff --git a/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm4/Identity.class b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm4/Identity.class new file mode 100644 index 0000000..67723d0 Binary files /dev/null and b/JavaSE/bin/mine/thirtyThree/RegularExpression/Project20181128pm4/Identity.class differ diff --git a/JavaSE/bin/mine/thirtyThree/RegularExpression/fuhao/FuHao.class b/JavaSE/bin/mine/thirtyThree/RegularExpression/fuhao/FuHao.class new file mode 100644 index 0000000..5d82da6 Binary files /dev/null and b/JavaSE/bin/mine/thirtyThree/RegularExpression/fuhao/FuHao.class differ diff --git a/JavaSE/bin/mine/thirtyTwo/carRentSystem/Bus.class b/JavaSE/bin/mine/thirtyTwo/carRentSystem/Bus.class new file mode 100644 index 0000000..3cf7806 Binary files /dev/null and b/JavaSE/bin/mine/thirtyTwo/carRentSystem/Bus.class differ diff --git a/JavaSE/bin/mine/thirtyTwo/carRentSystem/Car.class b/JavaSE/bin/mine/thirtyTwo/carRentSystem/Car.class new file mode 100644 index 0000000..63c3214 Binary files /dev/null and b/JavaSE/bin/mine/thirtyTwo/carRentSystem/Car.class differ diff --git a/JavaSE/bin/mine/thirtyTwo/carRentSystem/KaChe.class b/JavaSE/bin/mine/thirtyTwo/carRentSystem/KaChe.class new file mode 100644 index 0000000..a9f7c05 Binary files /dev/null and b/JavaSE/bin/mine/thirtyTwo/carRentSystem/KaChe.class differ diff --git a/JavaSE/bin/mine/thirtyTwo/carRentSystem/ProjectTest.class b/JavaSE/bin/mine/thirtyTwo/carRentSystem/ProjectTest.class new file mode 100644 index 0000000..7537dc3 Binary files /dev/null and b/JavaSE/bin/mine/thirtyTwo/carRentSystem/ProjectTest.class differ diff --git a/JavaSE/bin/mine/thirtyTwo/carRentSystem/Vehicle.class b/JavaSE/bin/mine/thirtyTwo/carRentSystem/Vehicle.class new file mode 100644 index 0000000..50b7950 Binary files /dev/null and b/JavaSE/bin/mine/thirtyTwo/carRentSystem/Vehicle.class differ diff --git a/JavaSE/bin/mine/three/shuixianhuashu/ShuiXianHuaShu.class b/JavaSE/bin/mine/three/shuixianhuashu/ShuiXianHuaShu.class new file mode 100644 index 0000000..ab17927 Binary files /dev/null and b/JavaSE/bin/mine/three/shuixianhuashu/ShuiXianHuaShu.class differ diff --git a/JavaSE/bin/mine/twelve/hero/Assassin.class b/JavaSE/bin/mine/twelve/hero/Assassin.class new file mode 100644 index 0000000..e30f0ec Binary files /dev/null and b/JavaSE/bin/mine/twelve/hero/Assassin.class differ diff --git a/JavaSE/bin/mine/twelve/hero/Hero.class b/JavaSE/bin/mine/twelve/hero/Hero.class new file mode 100644 index 0000000..657b317 Binary files /dev/null and b/JavaSE/bin/mine/twelve/hero/Hero.class differ diff --git a/JavaSE/bin/mine/twelve/hero/Rabbi.class b/JavaSE/bin/mine/twelve/hero/Rabbi.class new file mode 100644 index 0000000..c0a42c6 Binary files /dev/null and b/JavaSE/bin/mine/twelve/hero/Rabbi.class differ diff --git a/JavaSE/bin/mine/twelve/hero/Shooter.class b/JavaSE/bin/mine/twelve/hero/Shooter.class new file mode 100644 index 0000000..f19220c Binary files /dev/null and b/JavaSE/bin/mine/twelve/hero/Shooter.class differ diff --git a/JavaSE/bin/mine/twelve/hero/Warrior.class b/JavaSE/bin/mine/twelve/hero/Warrior.class new file mode 100644 index 0000000..052e01d Binary files /dev/null and b/JavaSE/bin/mine/twelve/hero/Warrior.class differ diff --git a/JavaSE/bin/mine/twentyEight/caipiao2/CaiPiao2.class b/JavaSE/bin/mine/twentyEight/caipiao2/CaiPiao2.class new file mode 100644 index 0000000..5122dce Binary files /dev/null and b/JavaSE/bin/mine/twentyEight/caipiao2/CaiPiao2.class differ diff --git a/JavaSE/bin/mine/twentyEight/caipiao2/Caipiao.class b/JavaSE/bin/mine/twentyEight/caipiao2/Caipiao.class new file mode 100644 index 0000000..0e30730 Binary files /dev/null and b/JavaSE/bin/mine/twentyEight/caipiao2/Caipiao.class differ diff --git a/JavaSE/bin/mine/twentyFive/recursion/rabbit/Rabbit.class b/JavaSE/bin/mine/twentyFive/recursion/rabbit/Rabbit.class new file mode 100644 index 0000000..ad193a7 Binary files /dev/null and b/JavaSE/bin/mine/twentyFive/recursion/rabbit/Rabbit.class differ diff --git a/JavaSE/bin/mine/twentyFour/recursion/jiujiu/JiuJiu.class b/JavaSE/bin/mine/twentyFour/recursion/jiujiu/JiuJiu.class new file mode 100644 index 0000000..4350262 Binary files /dev/null and b/JavaSE/bin/mine/twentyFour/recursion/jiujiu/JiuJiu.class differ diff --git a/JavaSE/bin/mine/twentyNine/breakWhileA/Demo.class b/JavaSE/bin/mine/twentyNine/breakWhileA/Demo.class new file mode 100644 index 0000000..9893488 Binary files /dev/null and b/JavaSE/bin/mine/twentyNine/breakWhileA/Demo.class differ diff --git a/JavaSE/bin/mine/twentyOne/map/mapDemo.class b/JavaSE/bin/mine/twentyOne/map/mapDemo.class new file mode 100644 index 0000000..22792b8 Binary files /dev/null and b/JavaSE/bin/mine/twentyOne/map/mapDemo.class differ diff --git a/JavaSE/bin/mine/twentySeven/caipiao/CaiPiao.class b/JavaSE/bin/mine/twentySeven/caipiao/CaiPiao.class new file mode 100644 index 0000000..3089927 Binary files /dev/null and b/JavaSE/bin/mine/twentySeven/caipiao/CaiPiao.class differ diff --git a/JavaSE/bin/mine/twentySix/IO/Menu.class b/JavaSE/bin/mine/twentySix/IO/Menu.class new file mode 100644 index 0000000..f38cb65 Binary files /dev/null and b/JavaSE/bin/mine/twentySix/IO/Menu.class differ diff --git a/JavaSE/bin/mine/twentyTwoAndThree/bubbleSort/Question22.class b/JavaSE/bin/mine/twentyTwoAndThree/bubbleSort/Question22.class new file mode 100644 index 0000000..0b83e99 Binary files /dev/null and b/JavaSE/bin/mine/twentyTwoAndThree/bubbleSort/Question22.class differ diff --git a/JavaSE/bin/mine/two/calculator/JiSuanQi.class b/JavaSE/bin/mine/two/calculator/JiSuanQi.class new file mode 100644 index 0000000..ba60363 Binary files /dev/null and b/JavaSE/bin/mine/two/calculator/JiSuanQi.class differ diff --git "a/JavaSE/bin/note/JAVA\345\237\272\347\241\200\345\256\236\350\256\255\347\273\203\344\271\240.docx" "b/JavaSE/bin/note/JAVA\345\237\272\347\241\200\345\256\236\350\256\255\347\273\203\344\271\240.docx" new file mode 100644 index 0000000..1b1ea81 Binary files /dev/null and "b/JavaSE/bin/note/JAVA\345\237\272\347\241\200\345\256\236\350\256\255\347\273\203\344\271\240.docx" differ diff --git a/JavaSE/bin/note/JavaSe.docx b/JavaSE/bin/note/JavaSe.docx new file mode 100644 index 0000000..3a57bf2 Binary files /dev/null and b/JavaSE/bin/note/JavaSe.docx differ diff --git "a/JavaSE/bin/note/JavaSe\346\200\273\347\273\223" "b/JavaSE/bin/note/JavaSe\346\200\273\347\273\223" new file mode 100644 index 0000000..9141c4e --- /dev/null +++ "b/JavaSE/bin/note/JavaSe\346\200\273\347\273\223" @@ -0,0 +1,148 @@ +public static 包装类 valueOf(相应基本数据类型); +int intValue(Integer i); +static int Integer.parseInt(String); + +String: +public char charAt(int index); +public int compareTo(String str); +public String(byte[] bytes, int offset, int length); +public String(char[] value, int offset, int count); +public boolean endsWith(String suffix); +public int indexOf(int ch); +public int indexOf(int ch, int fromIndex); +public int indexOf(String str); +public int indexOf(String str, int fromIndex); +public int lastIndexOf(int ch) +public boolean isEmpty(); +public String substring(int beginIndex); +public String substring(int beginIndex, int endIndex); +public char[] toCharArray(); +length(); +toLowerCase(); +toUpperCase(); +Arrays.toString(arr); +Arrays.sort(arr); +Arrays.copyOf(int[] original, int newLength); + +正则: +[]-------表示一个位置,如果该位置上只有一种可能,可以忽略不写 +()-------表示一个组合(至少是两位,并且是连续的) +{}-------用来定义字符串长度的范围 +public String[] split(regex); +public boolean matches(regex); + +StringBuffer/StringBuilder: +append(Object obj); +insert(int index, Object obj); +delete(int beginIndex, int endIndex); +deleteCharAt(int index); + +Collection: +boolean add(Object obj); +void add(int index, Object obj); +int size(); +void clear(); +boolean isEmpty(); +boolean contains(); +E get(int index); +E set(int index, E element); +E remove(int index); +boolean remove(Object obj); +void addFirst(E e); //only used in LinkedList +void addLast(E e); //only used in LinkedList +public static List Arrays.asList(Array arr); +list.toArray(arr); +Collections.sort(list); + +Map: +V put(K k, V v); +Set keySet(); +int size(); +V remove(K k); +boolean remove(K k, V v); +public boolean containsKey(Object key); +public boolean containsValue(Object value); +V get(Object key); +boolean isEmpty(); +public void clear(); + +Iterator; +Iterator it = list/set.iterator(); +boolean hasNext(); +E next(); + +File: +public static String separator; +public boolean createNewFile() throws IOException; +public boolean mkdir(); +public boolean delete(); +public File getAbsoluteFile(); +public String getAbsolutePath(); +public String getName(); +public int compareTo(File f); +public long length();获取文件中符号的个数 +public File[] listFiles(); +public String[] list(); +public boolean exists(); +public boolean isAbsolute(); +public boolean isDirectory(); +public boolean isFile(); +public boolean isHidden(); + +Reader://字符 + FileReader: public int read(), + public int read(char[] buf) + BufferedReader: public int read(), + public int read(char[] buf, int off, int len), + String readLine() +Writer: //字符 + FileWriter: public void write(char[] buf), + public void write(char[] buf, int beginIndex, int len), + public void write(String str), + public void write(String str, int beginIndex, int len) + BufferedWriter: public void write(int ch), + public void write(char[] buf, int off, int len), + public void write(String str, int off, int len), + public void newLine() +InputStream: //字节 + FileInputStream: public int read(), + public int read(byte[] buf), + public int read(byte[] buf,int beginIndex,int len) + BufferedInputStream: public int read(), + public int read(byte[] buf,int beginIndex,int len) +OutputStream: //字节 + FileOutputStream: public void write(int b), + public void write(byte[] buf), + public void write(byte[] buf,int beginIndex,int len) + BufferedOutputStream: public void write(int b), + public void write(byte[] buf,int beginIndex,int len) +InputStreamReader/OutputStreamWriter //转换流 + +for(int i=1;iar[middle]){ + begin=middle+1; + }else{ + end=middle-1; + } + } + return -1; + } + +线程:在word里的截图。 + diff --git "a/JavaSE/bin/note/Java\345\237\272\347\241\200~Java\351\253\230\347\272\247\346\243\200\346\265\213\351\242\230.docm" "b/JavaSE/bin/note/Java\345\237\272\347\241\200~Java\351\253\230\347\272\247\346\243\200\346\265\213\351\242\230.docm" new file mode 100644 index 0000000..97a4b11 Binary files /dev/null and "b/JavaSE/bin/note/Java\345\237\272\347\241\200~Java\351\253\230\347\272\247\346\243\200\346\265\213\351\242\230.docm" differ diff --git a/JavaSE/src/liucong/JavaSe(Liucong).zip b/JavaSE/src/liucong/JavaSe(Liucong).zip new file mode 100644 index 0000000..4c4ae26 Binary files /dev/null and b/JavaSE/src/liucong/JavaSe(Liucong).zip differ diff --git a/JavaSE/src/mine/eight/random/Random.java b/JavaSE/src/mine/eight/random/Random.java new file mode 100644 index 0000000..e46a382 --- /dev/null +++ b/JavaSE/src/mine/eight/random/Random.java @@ -0,0 +1,21 @@ +package mine.eight.random; + +import java.util.Scanner; + +public class Random { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Scanner sc = new Scanner(System.in); + int number = (int) (Math.random()*5);//[0,5) + String[] name = {"张三","李四","王五","小明","武丽娟"}; + System.out.print("1.抽奖\t2.退出"); + int num = sc.nextInt(); + if(num==1){ + System.out.println("幸运用户为:"+ name[number]); + }else{ + System.out.println("退出抽奖系统."); + } + } + +} diff --git a/JavaSE/src/mine/eleven/staticdemo/StaticDemo.java b/JavaSE/src/mine/eleven/staticdemo/StaticDemo.java new file mode 100644 index 0000000..e95b1d2 --- /dev/null +++ b/JavaSE/src/mine/eleven/staticdemo/StaticDemo.java @@ -0,0 +1,30 @@ +package mine.eleven.staticdemo; + +import java.util.Scanner; + +public class StaticDemo { + private static int count = 0; + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("请投票: "); + Scanner in = new Scanner(System.in); + int choice; + while(count<=100){ + System.out.println("查询当前票数请输入: chaxun\n投票请输入:toupiao"); + String check = in.nextLine(); + if("chaxun".equals(check)){ + System.out.println("当前票数为:"+count); + }else if("toupiao".equals(check)){ + System.out.println("请投票: "); + choice = in.nextInt(); + System.out.println("感谢投票!"); + count++; + }else{ + System.out.println("无效指令,请重新输入!"); + } + } + System.out.println("提示投票已结束!"); + } + +} diff --git a/JavaSE/src/mine/fifteen/zhihuan/ZhiHuan.java b/JavaSE/src/mine/fifteen/zhihuan/ZhiHuan.java new file mode 100644 index 0000000..0274d0b --- /dev/null +++ b/JavaSE/src/mine/fifteen/zhihuan/ZhiHuan.java @@ -0,0 +1,27 @@ +package mine.fifteen.zhihuan; + +import java.util.Arrays; +import java.util.Scanner; + +public class ZhiHuan { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("请输入一串数字:"); + Scanner in = new Scanner(System.in); + int number = in.nextInt(); + String number2 = String.valueOf(number); + char[] number3 = new char[number2.length()]; + number3 = number2.toCharArray(); + char t; + for(int i=0; i<(number3.length+1)/2-1; i++){ + t = number3[number3.length-1-i]; + number3[number3.length-1-i] = number3[i]; + number3[i] = t; + } + number2 = String.valueOf(number3); + number = Integer.parseInt(number2); + System.out.println(number); + } + +} diff --git a/JavaSE/src/mine/five/shopping/Shopping.java b/JavaSE/src/mine/five/shopping/Shopping.java new file mode 100644 index 0000000..25e37bd --- /dev/null +++ b/JavaSE/src/mine/five/shopping/Shopping.java @@ -0,0 +1,24 @@ +package mine.five.shopping; + +import java.util.Scanner; + +public class Shopping { + + public static void main(String[] args) { + // TODO Auto-generated method stub + + System.out.println("n 退出:\n其他显示菜单:"); + Scanner in = new Scanner(System.in); + + String choice = in.next(); + while((!"n".equals(choice))){ + System.out.println("欢迎使用乾包商城购物系统\n" + + "1)T恤\t¥198.00\n" + + "2)篮球\t¥588.88\n" + + "3)ipad\t¥2018.18"); + choice = in.next(); + } + System.out.println("结束"); + } + +} diff --git a/JavaSE/src/mine/four/houchitao/HouZiChiTao.java b/JavaSE/src/mine/four/houchitao/HouZiChiTao.java new file mode 100644 index 0000000..5345bb4 --- /dev/null +++ b/JavaSE/src/mine/four/houchitao/HouZiChiTao.java @@ -0,0 +1,15 @@ +package mine.four.houchitao; + +public class HouZiChiTao { + + public static void main(String[] args) { + // TODO Auto-generated method stub + int n =1; + for(int i=1; i<10; i++){ + n = 2*(n+1); + } + System.out.println(n); + + } + +} diff --git a/JavaSE/src/mine/fourteen/zimu/ZiMu.java b/JavaSE/src/mine/fourteen/zimu/ZiMu.java new file mode 100644 index 0000000..3513025 --- /dev/null +++ b/JavaSE/src/mine/fourteen/zimu/ZiMu.java @@ -0,0 +1,21 @@ +package mine.fourteen.zimu; + +import java.util.Scanner; + +public class ZiMu { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("请输入一串字母:"); + Scanner in = new Scanner(System.in); + String input = in.nextLine(); + char[] aCount = input.toCharArray(); + int count = 0; + for(int i=0; iarr[mid]){ + max = mid-1; + //System.out.println("Test2:"+"min:"+min+"mid:"+mid+"max:"+max); + }else if(number==arr[mid]){ + //System.out.println("Test3:"+"min:"+min+"mid:"+mid+"max:"+max); + return mid; + } + } + return -1; + } + + public static int[] chaRu(int[] arr, int number){ + int n=0; + for(n=0; narr[n]){ + break; + } + } + + int[] arr2 = new int[7]; + arr2[n] = number; + + for(int m=0; m listDemo = new LinkedList(); + for(int i=0; i<10; i++){ + listDemo.add((int) (Math.random()*100)); + } + Collections.sort(listDemo); + System.out.println(listDemo); + } + +} diff --git a/JavaSE/src/mine/thirty/CollectionAndMap/set/setDemo.java b/JavaSE/src/mine/thirty/CollectionAndMap/set/setDemo.java new file mode 100644 index 0000000..d9564d0 --- /dev/null +++ b/JavaSE/src/mine/thirty/CollectionAndMap/set/setDemo.java @@ -0,0 +1,33 @@ +package mine.thirty.CollectionAndMap.set; + +import java.util.*; + +public class setDemo { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Set setDemo = new HashSet(); + while(setDemo.size()<10){ + setDemo.add((int) (Math.random()*100)); + } + System.out.println(setDemo); + + outputRed();//20题 + } + + public static void outputRed(){ + String[] card = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"}; + HashSet setDemo2 = new HashSet(); + while(setDemo2.size()<13){ + setDemo2.add((int) (Math.random()*54+1)); + } + Iterator it = setDemo2.iterator(); + while(it.hasNext()){ + int a = it.next(); + if(a<=13){ + System.out.printf("红桃 %s\n", card[a-1]); + } + } + } + +} diff --git a/JavaSE/src/mine/thirty/CollectionAndMap/summary/ArrayListDemo.java b/JavaSE/src/mine/thirty/CollectionAndMap/summary/ArrayListDemo.java new file mode 100644 index 0000000..5337a72 --- /dev/null +++ b/JavaSE/src/mine/thirty/CollectionAndMap/summary/ArrayListDemo.java @@ -0,0 +1,29 @@ +package mine.thirty.CollectionAndMap.summary; + +import java.lang.reflect.Array; +import java.util.*; + +public class ArrayListDemo { + + public static void main(String[] args) { + // TODO Auto-generated method stub + + ArrayList al = new ArrayList(); + al.add(3); + al.add(14); + al.add(1, 666); + al.add(22); + al.add(666); + al.add(25); + System.out.println(al); + System.out.println(al.remove(2)); + System.out.println(al.remove(3.14)); + System.out.println(al); + Integer[] arr = new Integer[al.size()]; + al.toArray(arr); + System.out.println(Arrays.toString(arr)); + List a2 = Arrays.asList(arr); + System.out.println(a2); + } + +} diff --git a/JavaSE/src/mine/thirty/CollectionAndMap/summary/HashMapDemo.java b/JavaSE/src/mine/thirty/CollectionAndMap/summary/HashMapDemo.java new file mode 100644 index 0000000..3aefd49 --- /dev/null +++ b/JavaSE/src/mine/thirty/CollectionAndMap/summary/HashMapDemo.java @@ -0,0 +1,18 @@ +package mine.thirty.CollectionAndMap.summary; + +import java.util.*; + +public class HashMapDemo { + + public static void main(String[] args) { + // TODO Auto-generated method stub + + HashMap map = new HashMap(); + System.out.println(map.put("辽宁",null)); + System.out.println(map.put("吉林","长春")); + System.out.println(map.remove("辽宁")); + System.out.println(map); + System.out.println(map.keySet()); + } + +} diff --git a/JavaSE/src/mine/thirty/CollectionAndMap/summary/HashSetDemo.java b/JavaSE/src/mine/thirty/CollectionAndMap/summary/HashSetDemo.java new file mode 100644 index 0000000..09a3095 --- /dev/null +++ b/JavaSE/src/mine/thirty/CollectionAndMap/summary/HashSetDemo.java @@ -0,0 +1,23 @@ +package mine.thirty.CollectionAndMap.summary; + +import java.util.*; + +public class HashSetDemo { + + public static void main(String[] args) { + // TODO Auto-generated method stub + HashSet set = new HashSet(); + System.out.println(set.add(55)); + System.out.println(set.add(77)); + System.out.println(set.add(88)); + System.out.println(set.add(66)); + for(Integer i:set){ + System.out.println(i); + } + Iterator it = set.iterator(); + while(it.hasNext()){ + System.out.print(it.next()+" "); + } + } + +} diff --git a/JavaSE/src/mine/thirty/CollectionAndMap/summary/LinkedListDemo.java b/JavaSE/src/mine/thirty/CollectionAndMap/summary/LinkedListDemo.java new file mode 100644 index 0000000..bbf34a1 --- /dev/null +++ b/JavaSE/src/mine/thirty/CollectionAndMap/summary/LinkedListDemo.java @@ -0,0 +1,18 @@ +package mine.thirty.CollectionAndMap.summary; + +import java.util.*; + +public class LinkedListDemo { + + public static void main(String[] args) { + // TODO Auto-generated method stub + + LinkedList ll = new LinkedList(); + ll.addLast("java01"); + ll.addLast("java02"); + ll.addLast("java03");//永远在下标为0的位置插入 + ll.addLast("java04");//永远在下标为size()-1的位置插入 + System.out.println(ll); + } + +} diff --git a/JavaSE/src/mine/thirtyFive/StringInteger/Demo.java b/JavaSE/src/mine/thirtyFive/StringInteger/Demo.java new file mode 100644 index 0000000..01e158c --- /dev/null +++ b/JavaSE/src/mine/thirtyFive/StringInteger/Demo.java @@ -0,0 +1,23 @@ +package mine.thirtyFive.StringInteger; + +public class Demo { + + public static void main(String[] args) { + String s = "H4e5l2lo3Wol2d";//有长度,是0, return true + String s1 = " Hello World ";//空对象,没长度, NullPointerException + String s2 = " Hello World ";//有对象,有长度,是0,return true + System.out.println(s.toLowerCase()); + System.out.println(s1.toUpperCase()); + String[] strings = s.split("\\w"); + for(String st:strings){ + System.out.println(st); + } + +// Test t1 = new Test(126, 126); +// Test t2 = new Test(129, 129); +// Test t3 = new Test(127, 127); +// System.out.println(t1.isTrue() && t2.isTrue()); +// System.out.println(t1.isTrue() && t3.isTrue()); +// System.out.println(t2.isTrue()); + } +} diff --git a/JavaSE/src/mine/thirtyFive/StringInteger/Test.java b/JavaSE/src/mine/thirtyFive/StringInteger/Test.java new file mode 100644 index 0000000..232ef71 --- /dev/null +++ b/JavaSE/src/mine/thirtyFive/StringInteger/Test.java @@ -0,0 +1,19 @@ +package mine.thirtyFive.StringInteger; + +public class Test { + + Integer a; + Integer b; + public Test(int a, int b) { + super(); + this.a = a; + this.b = b; + } + + public boolean isTrue(){ + if((a>-128 && a<127) && (b>-128 && b<127)){ + return a==b; + } + return a.equals(b); + } +} diff --git a/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question1.java b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question1.java new file mode 100644 index 0000000..f022c78 --- /dev/null +++ b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question1.java @@ -0,0 +1,25 @@ +package mine.thirtyFour.StringBufferCollection; + + +import java.util.Scanner; + +public class Question1 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("请输入一串数字: "); + Scanner in = new Scanner(System.in); + Integer number = in.nextInt(); + StringBuffer sbuf = new StringBuffer(number.toString()); +// int count = number.length()%3; +// count = (count==0) ? 3: count; +// for(int i=count; i0;i-=3){ + sbuf.insert(i, ","); + } + System.out.println(sbuf.toString()); + } + +} diff --git a/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question2.java b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question2.java new file mode 100644 index 0000000..4ffe348 --- /dev/null +++ b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question2.java @@ -0,0 +1,18 @@ +package mine.thirtyFour.StringBufferCollection; + +import java.util.*; + +public class Question2 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + ArrayList list = new ArrayList(); + Random r = new Random(); + for(int i=0; i<10; i++){ + list.add(r.nextInt(100)); + } + Collections.sort(list); + System.out.println(list); + } + +} diff --git a/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question3.java b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question3.java new file mode 100644 index 0000000..91b351f --- /dev/null +++ b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question3.java @@ -0,0 +1,18 @@ +package mine.thirtyFour.StringBufferCollection; + + +import java.util.*; + +public class Question3 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + HashSet hs = new HashSet(); + Random r = new Random(); + while (hs.size()<10) { + hs.add(r.nextInt(100)); + } + System.out.println(hs); + } + +} diff --git a/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question4.java b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question4.java new file mode 100644 index 0000000..b895a3b --- /dev/null +++ b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question4.java @@ -0,0 +1,25 @@ +package mine.thirtyFour.StringBufferCollection; + + +import java.util.*; + +public class Question4 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + String[] card = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"}; + HashSet hs = new HashSet(); + Random r = new Random(); + while(hs.size()<13){ + hs.add(r.nextInt(54)+1); + } + Iterator it = hs.iterator(); + while(it.hasNext()){ + int a = it.next(); + if(a<=13){ + System.out.printf("红桃 %s\n", card[a-1]); + } + } + } + +} diff --git a/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question5.java b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question5.java new file mode 100644 index 0000000..2814cd4 --- /dev/null +++ b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question5.java @@ -0,0 +1,25 @@ +package mine.thirtyFour.StringBufferCollection; + + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Scanner; + +public class Question5 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Map provience = new HashMap(); + provience.put("辽宁省", new String[]{"沈阳","大连","锦州"}); + provience.put("河北省", new String[]{"石家庄","保定","衡水"}); + provience.put("null", new String[]{"北京","上海","天津","重庆"}); + + System.out.println("请输入一个省份:"); + Scanner in = new Scanner(System.in); + String input = in.next(); + String[] cities = provience.get(input); + System.out.println(cities==null? "没有你要去的省份.":Arrays.toString(cities)); + } + +} diff --git a/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question6and7.java b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question6and7.java new file mode 100644 index 0000000..03eb29c --- /dev/null +++ b/JavaSE/src/mine/thirtyFour/StringBufferCollection/Question6and7.java @@ -0,0 +1,28 @@ +package mine.thirtyFour.StringBufferCollection; + + +import java.util.*; + +public class Question6and7 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + String str1 = "52 -5 02 11 99 -100"; + String str2 = "52 -5 2 11 99 -10"; + str1 = sortString(str1); + str2 = sortString(str2); + System.out.println(str1+"\n"+str2); + } + + public static String sortString(String str){ + String[] str1 = str.split(" "); + List str2 = Arrays.asList(str1); + Collections.sort(str2); + StringBuffer sb = new StringBuffer(); + for(int i=0; i choice = null;//用来存7个数的Set + while(choice==null){ + System.out.println("请输入选项: 1.手选\t2.机打"); + int hm = in.nextInt();//hand 或者 machine + switch (hm) { + case 1: + choice = hand(); + break; + case 2: + choice = machine(); + break; + default: + System.out.print("非法输入,请重新输入。"); + break; + } + } + + System.out.println("开奖号码:"); + HashSet prizeCode = machine(); + Iterator it = prizeCode.iterator(); + while(it.hasNext()){ + System.out.printf("%02d ", it.next()); + } + + System.out.println(); + + System.out.println("已选号码:"); + it = choice.iterator(); + while(it.hasNext()){ + System.out.printf("%02d ", it.next()); + } + + System.out.println(); + + it = choice.iterator(); + int count = 0; + while(it.hasNext()){ + if(prizeCode.contains(it.next())){ + count++; + } + } + if(count>=0&&count<2){ + System.out.println("很遗憾,奖励棒棒糖一个"); + }else if(count>=2&&count<5){ + System.out.println("奖金1000元"); + }else if(count>=5&&count<7){ + System.out.println("奖金5000元"); + }else if(count==7){ + System.out.println("奖金10000元"); + } + + a: while(true){ + System.out.println("输入您的身份证号:"); + String id = in.next(); + if(identity(id)){ + while(true){ + System.out.println("输入您的姓名:"); + String name = in.next(); + if(nameRegex(name)){ + System.out.println("恭喜成功领取奖励!"); + break a; + }else{ + System.out.print("对不起,请重新"); + } + } + }else{ + System.out.print("对不起,请重新"); + } + } + } + /** + * 手选 + * @return HashSet + */ + public static HashSet hand(){ + HashSet a = new HashSet(); + Scanner in = new Scanner(System.in); + while(a.size()<7){ + System.out.printf("请输入第%d个数:\n", a.size()+1); + int number = in.nextInt(); + if(number<0||number>35){ + System.out.print("超出边界范围,请重新输入,"); + continue; + } + if(a.contains(number)){ + System.out.print("已重复,请重新输入,"); + continue; + } + a.add(number); + } + return a; + } + + /** + * 机选 + * @return HashSet + */ + public static HashSet machine(){ + HashSet a = new HashSet(); + while(a.size()<7){ + a.add((int) (Math.random()*35+1)); + } + return a; + } + + public static boolean nameRegex(String name) { + String nameStyle = "[\u4e00-\u9fa5]{2,3}"; + return name.matches(nameStyle); + } + + public static boolean identity(String id) { + String idStyle = "[1-9]\\d{5}(19|20)\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]"; + return id.matches(idStyle); + } +} \ No newline at end of file diff --git a/JavaSE/src/mine/thirtyOne/ExceptionDemo/basic/qb178_01/Demo.java b/JavaSE/src/mine/thirtyOne/ExceptionDemo/basic/qb178_01/Demo.java new file mode 100644 index 0000000..7123d1a --- /dev/null +++ b/JavaSE/src/mine/thirtyOne/ExceptionDemo/basic/qb178_01/Demo.java @@ -0,0 +1,30 @@ +package mine.thirtyOne.ExceptionDemo.basic.qb178_01; + +public class Demo { + + public static void main(String[] args) { + // TODO Auto-generated method stub + + String[] s = new String[2]; + try{ + System.out.println(s[3]); + System.out.println(s[0]); + }catch(ArrayIndexOutOfBoundsException ae){ + System.out.println("我是第二层子类"); + }catch(RuntimeException re){ + System.out.println("我是第一层子类"); + }catch(Exception e){ + System.out.println("我是父类"); + } + + try { + //可能出现异常的代码,任何一行代码出现异常,try中的余下代码均不执行。 + } catch(Exception e){//异常类 对象名 + //处理异常的代码 + }finally { + // TODO: handle finally clause + //无论是否出现异常都要执行的代码 + } + } + +} diff --git a/JavaSE/src/mine/thirtyOne/ExceptionDemo/basic/qb178_02/Demo.java b/JavaSE/src/mine/thirtyOne/ExceptionDemo/basic/qb178_02/Demo.java new file mode 100644 index 0000000..1467efb --- /dev/null +++ b/JavaSE/src/mine/thirtyOne/ExceptionDemo/basic/qb178_02/Demo.java @@ -0,0 +1,32 @@ +package mine.thirtyOne.ExceptionDemo.basic.qb178_02; + +import java.io.*; + +public class Demo { + + public static void main(String[] args) { + // TODO Auto-generated method stub + + File file = new File("test.txt"); + File f = new File("d:\\game"); + try { + System.out.println(file.isDirectory()); + System.out.println(file.exists()); + System.out.println(file.delete()); + System.out.println(file.equals(f)); + System.out.println(file.createNewFile()); + System.out.println(f.getAbsolutePath()); + System.out.println(file.getAbsoluteFile()); + System.out.println(file.getName()); + System.out.println(f.mkdir()); + String[] files = f.list(); + for(String fi:files){ + System.out.println(fi); + } + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} diff --git a/JavaSE/src/mine/thirtyOne/ExceptionDemo/basic/qb178_03/Demo.java b/JavaSE/src/mine/thirtyOne/ExceptionDemo/basic/qb178_03/Demo.java new file mode 100644 index 0000000..43046b2 --- /dev/null +++ b/JavaSE/src/mine/thirtyOne/ExceptionDemo/basic/qb178_03/Demo.java @@ -0,0 +1,32 @@ +package mine.thirtyOne.ExceptionDemo.basic.qb178_03; + +import java.io.*; + +public class Demo { + + public static void main(String[] args) { + // TODO Auto-generated method stub + + FileReader fr = null; + try { + fr = new FileReader("d:\\aa.docx"); + int len = 0; + while((len=fr.read())!=-1){ + System.out.print((char)len); + } + } catch (IOException e) { + e.printStackTrace(); + } + finally { + try { + if(fr!=null){ + fr.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + System.out.println("成功"); + } + } + +} diff --git a/JavaSE/src/mine/thirtyOne/ExceptionDemo/project/Project02/Demo.java b/JavaSE/src/mine/thirtyOne/ExceptionDemo/project/Project02/Demo.java new file mode 100644 index 0000000..4259c17 --- /dev/null +++ b/JavaSE/src/mine/thirtyOne/ExceptionDemo/project/Project02/Demo.java @@ -0,0 +1,18 @@ +package mine.thirtyOne.ExceptionDemo.project.Project02; + +public class Demo { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Myself m = new Myself(); + try { + m.shang(5,5); + } catch (NotZeroException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} diff --git a/JavaSE/src/mine/thirtyOne/ExceptionDemo/project/Project02/Myself.java b/JavaSE/src/mine/thirtyOne/ExceptionDemo/project/Project02/Myself.java new file mode 100644 index 0000000..53a740c --- /dev/null +++ b/JavaSE/src/mine/thirtyOne/ExceptionDemo/project/Project02/Myself.java @@ -0,0 +1,11 @@ +package mine.thirtyOne.ExceptionDemo.project.Project02; + +public class Myself { + + public double shang(double num1, double num2) throws NotZeroException, Exception{ + if(num2==0){ + throw new NotZeroException("除数不能为0"); + } + return num1/num2; + } +} diff --git a/JavaSE/src/mine/thirtyOne/ExceptionDemo/project/Project02/NotZeroException.java b/JavaSE/src/mine/thirtyOne/ExceptionDemo/project/Project02/NotZeroException.java new file mode 100644 index 0000000..56b0ee6 --- /dev/null +++ b/JavaSE/src/mine/thirtyOne/ExceptionDemo/project/Project02/NotZeroException.java @@ -0,0 +1,9 @@ +package mine.thirtyOne.ExceptionDemo.project.Project02; + +public class NotZeroException extends Exception{ + + public NotZeroException(String message) { + // TODO Auto-generated constructor stub + super(message); + } +} \ No newline at end of file diff --git a/JavaSE/src/mine/thirtySeven/airplane/imgs/airplane.jpg b/JavaSE/src/mine/thirtySeven/airplane/imgs/airplane.jpg new file mode 100644 index 0000000..9ec7d72 Binary files /dev/null and b/JavaSE/src/mine/thirtySeven/airplane/imgs/airplane.jpg differ diff --git a/JavaSE/src/mine/thirtySeven/airplane/imgs/background.jpg b/JavaSE/src/mine/thirtySeven/airplane/imgs/background.jpg new file mode 100644 index 0000000..96bb3a7 Binary files /dev/null and b/JavaSE/src/mine/thirtySeven/airplane/imgs/background.jpg differ diff --git a/JavaSE/src/mine/thirtySeven/airplane/imgs/bee.jpg b/JavaSE/src/mine/thirtySeven/airplane/imgs/bee.jpg new file mode 100644 index 0000000..e746264 Binary files /dev/null and b/JavaSE/src/mine/thirtySeven/airplane/imgs/bee.jpg differ diff --git a/JavaSE/src/mine/thirtySeven/airplane/imgs/bullet.jpg b/JavaSE/src/mine/thirtySeven/airplane/imgs/bullet.jpg new file mode 100644 index 0000000..88ace59 Binary files /dev/null and b/JavaSE/src/mine/thirtySeven/airplane/imgs/bullet.jpg differ diff --git a/JavaSE/src/mine/thirtySeven/airplane/imgs/gameover.jpg b/JavaSE/src/mine/thirtySeven/airplane/imgs/gameover.jpg new file mode 100644 index 0000000..47a88e5 Binary files /dev/null and b/JavaSE/src/mine/thirtySeven/airplane/imgs/gameover.jpg differ diff --git a/JavaSE/src/mine/thirtySeven/airplane/imgs/hero0.jpg b/JavaSE/src/mine/thirtySeven/airplane/imgs/hero0.jpg new file mode 100644 index 0000000..bbb856f Binary files /dev/null and b/JavaSE/src/mine/thirtySeven/airplane/imgs/hero0.jpg differ diff --git a/JavaSE/src/mine/thirtySeven/airplane/imgs/hero1.jpg b/JavaSE/src/mine/thirtySeven/airplane/imgs/hero1.jpg new file mode 100644 index 0000000..3c2c735 Binary files /dev/null and b/JavaSE/src/mine/thirtySeven/airplane/imgs/hero1.jpg differ diff --git a/JavaSE/src/mine/thirtySeven/airplane/imgs/icon.jpg b/JavaSE/src/mine/thirtySeven/airplane/imgs/icon.jpg new file mode 100644 index 0000000..b70413d Binary files /dev/null and b/JavaSE/src/mine/thirtySeven/airplane/imgs/icon.jpg differ diff --git a/JavaSE/src/mine/thirtySeven/airplane/imgs/pause.jpg b/JavaSE/src/mine/thirtySeven/airplane/imgs/pause.jpg new file mode 100644 index 0000000..0655f9d Binary files /dev/null and b/JavaSE/src/mine/thirtySeven/airplane/imgs/pause.jpg differ diff --git a/JavaSE/src/mine/thirtySeven/airplane/imgs/start.jpg b/JavaSE/src/mine/thirtySeven/airplane/imgs/start.jpg new file mode 100644 index 0000000..f7523f3 Binary files /dev/null and b/JavaSE/src/mine/thirtySeven/airplane/imgs/start.jpg differ diff --git a/JavaSE/src/mine/thirtySeven/airplane/plane/Airplane.java b/JavaSE/src/mine/thirtySeven/airplane/plane/Airplane.java new file mode 100644 index 0000000..a5f6996 --- /dev/null +++ b/JavaSE/src/mine/thirtySeven/airplane/plane/Airplane.java @@ -0,0 +1,40 @@ +package mine.thirtySeven.airplane.plane; + +import java.util.Random; + +/** + * 敌飞机: 是飞行物,也是敌人 + */ +public class Airplane extends FlyingObject implements Enemy { + private int speed = 3; //移动步骤 + + /** 初始化数据 */ + public Airplane(){ + this.image = ShootGame.airplane; + width = image.getWidth(); + height = image.getHeight(); + y = -height; + Random rand = new Random(); + x = rand.nextInt(ShootGame.WIDTH - width); + } + + /** 获取分数 */ + + public int getScore() { + return 5; + } + + /** //越界处理 */ + + public boolean outOfBounds() { + return y>ShootGame.HEIGHT; + } + + /** 移动 */ + + public void step() { + y += speed; + } + +} + diff --git a/JavaSE/src/mine/thirtySeven/airplane/plane/Award.java b/JavaSE/src/mine/thirtySeven/airplane/plane/Award.java new file mode 100644 index 0000000..c0a5fc7 --- /dev/null +++ b/JavaSE/src/mine/thirtySeven/airplane/plane/Award.java @@ -0,0 +1,8 @@ +package mine.thirtySeven.airplane.plane; + +public interface Award { + int DOUBLE_FIRE = 0; //双倍火力 + int LIFE = 1; //1条命 + /** 获得奖励类型(上面的0或1) */ + int getType(); +} diff --git a/JavaSE/src/mine/thirtySeven/airplane/plane/Bee.java b/JavaSE/src/mine/thirtySeven/airplane/plane/Bee.java new file mode 100644 index 0000000..ff51d4d --- /dev/null +++ b/JavaSE/src/mine/thirtySeven/airplane/plane/Bee.java @@ -0,0 +1,46 @@ +package mine.thirtySeven.airplane.plane; + +import java.util.Random; + +/** 蜜蜂 */ +public class Bee extends FlyingObject implements Award{ + private int xSpeed = 1; //x坐标移动速度 + private int ySpeed = 2; //y坐标移动速度 + private int awardType; //奖励类型 + + /** 初始化数据 */ + public Bee(){ + this.image = ShootGame.bee; + width = image.getWidth(); + height = image.getHeight(); + y = -height; + Random rand = new Random(); + x = rand.nextInt(ShootGame.WIDTH - width); + awardType = rand.nextInt(2); //初始化时给奖励 + } + + /** 获得奖励类型 */ + public int getType(){ + return awardType; + } + + /** 越界处理 */ + @Override + public boolean outOfBounds() { + return y>ShootGame.HEIGHT; + } + + /** 移动,可斜着飞 */ + @Override + public void step() { + x += xSpeed; + y += ySpeed; + if(x > ShootGame.WIDTH-width){ + xSpeed = -1; + } + if(x < 0){ + xSpeed = 1; + } + } +} + diff --git a/JavaSE/src/mine/thirtySeven/airplane/plane/Bullet.java b/JavaSE/src/mine/thirtySeven/airplane/plane/Bullet.java new file mode 100644 index 0000000..81d729d --- /dev/null +++ b/JavaSE/src/mine/thirtySeven/airplane/plane/Bullet.java @@ -0,0 +1,25 @@ +package mine.thirtySeven.airplane.plane; + +public class Bullet extends FlyingObject { + private int speed = 3; //移动的速度 + + /** 初始化数据 */ + public Bullet(int x,int y){ + this.x = x; + this.y = y; + this.image = ShootGame.bullet; + } + + /** 移动 */ + + public void step(){ + y-=speed; + } + + /** 越界处理 */ + + public boolean outOfBounds() { + return y<-height; + } + +} diff --git a/JavaSE/src/mine/thirtySeven/airplane/plane/Enemy.java b/JavaSE/src/mine/thirtySeven/airplane/plane/Enemy.java new file mode 100644 index 0000000..8434304 --- /dev/null +++ b/JavaSE/src/mine/thirtySeven/airplane/plane/Enemy.java @@ -0,0 +1,6 @@ +package mine.thirtySeven.airplane.plane; + +public interface Enemy { + /** 敌人的分数 */ + int getScore(); +} diff --git a/JavaSE/src/mine/thirtySeven/airplane/plane/FlyingObject.java b/JavaSE/src/mine/thirtySeven/airplane/plane/FlyingObject.java new file mode 100644 index 0000000..da026a9 --- /dev/null +++ b/JavaSE/src/mine/thirtySeven/airplane/plane/FlyingObject.java @@ -0,0 +1,78 @@ +package mine.thirtySeven.airplane.plane; + +import java.awt.image.BufferedImage; + +/** + * 飞行物(敌机,蜜蜂,子弹,英雄机) + */ +public abstract class FlyingObject { + protected int x; //x坐标 + protected int y; //y坐标 + protected int width; //宽 + protected int height; //高 + protected BufferedImage image; //图片 + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } + + public int getWidth() { + return width; + } + + public void setWidth(int width) { + this.width = width; + } + + public int getHeight() { + return height; + } + + public void setHeight(int height) { + this.height = height; + } + + public BufferedImage getImage() { + return image; + } + + public void setImage(BufferedImage image) { + this.image = image; + } + + /** + * 检查是否出界 + * @return true 出界与否 + */ + public abstract boolean outOfBounds(); + + /** + * 飞行物移动一步 + */ + public abstract void step(); + + /** + * 检查当前飞行物体是否被子弹(x,y)击(shoot)中 + * @param Bullet 子弹对象 + * @return true表示被击中了 + */ + public boolean shootBy(Bullet bullet){ + int x = bullet.x; //子弹横坐标 + int y = bullet.y; //子弹纵坐标 + return this.x0){ //双倍火力 + Bullet[] bullets = new Bullet[2]; + bullets[0] = new Bullet(x+xStep,y-yStep); //y-yStep(子弹距飞机的位置) + bullets[1] = new Bullet(x+3*xStep,y-yStep); + return bullets; + }else{ //单倍火力 + Bullet[] bullets = new Bullet[1]; + bullets[0] = new Bullet(x+2*xStep,y-yStep); + return bullets; + } + } + + /** 移动 */ + @Override + public void step() { + if(images.length>0){ + image = images[index++/10%images.length]; //切换图片hero0,hero1 + } + } + + /** 碰撞算法 */ + public boolean hit(FlyingObject other){ + + int x1 = other.x - this.width/2; //x坐标最小距离 + int x2 = other.x + this.width/2 + other.width; //x坐标最大距离 + int y1 = other.y - this.height/2; //y坐标最小距离 + int y2 = other.y + this.height/2 + other.height; //y坐标最大距离 + + int herox = this.x + this.width/2; //英雄机x坐标中心点距离 + int heroy = this.y + this.height/2; //英雄机y坐标中心点距离 + + return herox>x1 && heroxy1 && heroy=65&&r<=90) { + c[index++] = (char)r; + }else if (r>=97&&r<=122) { + c[index++] = (char)r; + }else if (r>=48&&r<=57) { + c[index++] = (char)r; + } + if(index == 4){ + break; + } + } + return String.valueOf(c); + } + + public boolean isRight(String str){ + return randomCode.equalsIgnoreCase(str); + } +} diff --git a/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm1/RandomCodeTest.java b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm1/RandomCodeTest.java new file mode 100644 index 0000000..e995b89 --- /dev/null +++ b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm1/RandomCodeTest.java @@ -0,0 +1,16 @@ +package mine.thirtyThree.RegularExpression.Project20181128pm1; +import java.util.Random; +import java.util.Scanner; + +public class RandomCodeTest { + + public static void main(String[] args) { + RandomCode rc = new RandomCode(); + rc.run(); + System.out.print("请输入四位验证码: "); + Scanner in = new Scanner(System.in); + System.out.println("输入是否和随机码一致: "+rc.isRight(in.next())); + } + + +} diff --git a/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm2/Email.java b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm2/Email.java new file mode 100644 index 0000000..2e949da --- /dev/null +++ b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm2/Email.java @@ -0,0 +1,25 @@ +package mine.thirtyThree.RegularExpression.Project20181128pm2; + +public class Email { + private String email; + + public Email(){} + + public Email(String email) { + super(); + this.email = email; + } + + public boolean isStyle(){ + boolean at = email.indexOf("@") == email.lastIndexOf("@");//只有一个@时为true + if(!at){ + System.out.print("@只能有一个,"); + return false; + }else if (!(email.endsWith(".com")||email.endsWith(".cn"))) { + System.out.print("必须以.com或.cn结尾,"); + return false; + } + return true; + } + +} diff --git a/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm2/EmailTest.java b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm2/EmailTest.java new file mode 100644 index 0000000..c1e4cc2 --- /dev/null +++ b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm2/EmailTest.java @@ -0,0 +1,15 @@ +package mine.thirtyThree.RegularExpression.Project20181128pm2; + +import java.util.Scanner; + +public class EmailTest { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.print("请输入邮箱地址: "); + Scanner in = new Scanner(System.in); + Email e = new Email(in.next()); + //e.isStyle(); + System.out.println(e.isStyle()?"此邮箱地址有效。":"此邮箱地址无效。"); + } +} diff --git a/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm3/CountTest.java b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm3/CountTest.java new file mode 100644 index 0000000..6e092fa --- /dev/null +++ b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm3/CountTest.java @@ -0,0 +1,15 @@ +package mine.thirtyThree.RegularExpression.Project20181128pm3; + +import java.util.Scanner; + +public class CountTest { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.print("请输入一个字符串: "); + Scanner in = new Scanner(System.in); + GCount gc = new GCount(in.next()); + System.out.println("g的个数为:"+gc.gCount()); + } + +} diff --git a/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm3/GCount.java b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm3/GCount.java new file mode 100644 index 0000000..7183980 --- /dev/null +++ b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm3/GCount.java @@ -0,0 +1,21 @@ +package mine.thirtyThree.RegularExpression.Project20181128pm3; + +public class GCount {//indexOf, substring + private String str; + + public GCount(String str) { + super(); + this.str = str; + } + + public int gCount() { + int beginIndex = str.indexOf('g'); + int count = 0; + while(beginIndex>-1){ + count++; + str = str.substring(beginIndex+1); + beginIndex = str.indexOf('g'); + } + return count; + } +} diff --git a/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm4/Identity.java b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm4/Identity.java new file mode 100644 index 0000000..388b3b3 --- /dev/null +++ b/JavaSE/src/mine/thirtyThree/RegularExpression/Project20181128pm4/Identity.java @@ -0,0 +1,21 @@ +package mine.thirtyThree.RegularExpression.Project20181128pm4; + +import java.util.Scanner; + +public class Identity { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("请输入身份证号: "); + Scanner in = new Scanner(System.in); + String s = in.next(); + String identity = "\\d{17}[A-Za-z0-9]"; + System.out.println(s.matches(identity)); + + System.out.println("请输入QQ号: "); + String s1 = in.next(); + String qqFormat = "[1-9]\\d{4,9}"; + System.out.println(s1.matches(qqFormat)); + } + +} diff --git a/JavaSE/src/mine/thirtyThree/RegularExpression/fuhao/FuHao.java b/JavaSE/src/mine/thirtyThree/RegularExpression/fuhao/FuHao.java new file mode 100644 index 0000000..a8f1e94 --- /dev/null +++ b/JavaSE/src/mine/thirtyThree/RegularExpression/fuhao/FuHao.java @@ -0,0 +1,39 @@ +package mine.thirtyThree.RegularExpression.fuhao; + +import java.util.Arrays; +import java.util.Scanner; + +public class FuHao { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("请输入一串字符: "); + Scanner in = new Scanner(System.in); + String s = in.next(); + String capLetter = "[A-Z]"; + String uncapLetter = "[a-z]"; + String number = "\\d"; + String character = "[\u4e00-\u9fa5]"; + String sign = "."; + + int daXie=0, xiaoXie=0, shuZi=0, hanZi=0, fuHao=0; + char[] s2 = s.toCharArray(); + + for(int i=0; i3&&dayAmount<=7){ + totalMoney *= THREE_DAY; + }else if(dayAmount>7&&dayAmount<=30){ + totalMoney *= SEVEN_DAY; + }else if(dayAmount>30&&dayAmount<=150){ + totalMoney *= THIRTY_DAY; + }else if(dayAmount>150){ + totalMoney *= ONE_HUNDRED_FIFTY_DAY; + } + return totalMoney; + } + + @Override + public String toString() { + return "Bus [infor=" + getInfor() + ", number=" + getNumber() + ", moneyPerDay=" + getMoneyPerDay() + ", dayAmount=" + + getDayAmount() + "seatCount=" + seatCount + "]"; + } + + +} diff --git a/JavaSE/src/mine/thirtyTwo/carRentSystem/Car.java b/JavaSE/src/mine/thirtyTwo/carRentSystem/Car.java new file mode 100644 index 0000000..5aacfbb --- /dev/null +++ b/JavaSE/src/mine/thirtyTwo/carRentSystem/Car.java @@ -0,0 +1,39 @@ +package mine.thirtyTwo.carRentSystem; + +public class Car extends Vehicle{ + + public static final double SEVEN_DAY = 0.9; + public static final double THIRTY_DAY = 0.8; + public static final double ONE_HUNDRED_FIFTY_DAY = 0.7; + + private String attribute; + + public Car(String infor, String number, int moneyPerDay, String attribute) { + super(infor, number, moneyPerDay); + this.attribute = attribute; + } + + @Override + public int discount() { + int dayAmount = getDayAmount(); + int totalMoney = getMoneyPerDay()*dayAmount; + if(dayAmount>7&&dayAmount<=30){ + totalMoney *= SEVEN_DAY; + }else if(dayAmount>30&&dayAmount<=150){ + totalMoney *= THIRTY_DAY; + }else if(dayAmount>150){ + totalMoney *= ONE_HUNDRED_FIFTY_DAY; + } + return totalMoney; + } + + @Override + public String toString() { + return "Car [infor=" + getInfor() + ", number=" + getNumber() + ", moneyPerDay=" + getMoneyPerDay() + ", dayAmount=" + + getDayAmount() + "attribute=" + attribute + "]"; + } + + + + +} diff --git a/JavaSE/src/mine/thirtyTwo/carRentSystem/KaChe.java b/JavaSE/src/mine/thirtyTwo/carRentSystem/KaChe.java new file mode 100644 index 0000000..172a43f --- /dev/null +++ b/JavaSE/src/mine/thirtyTwo/carRentSystem/KaChe.java @@ -0,0 +1,35 @@ +package mine.thirtyTwo.carRentSystem; + +public class KaChe extends Vehicle{ + + private int heavy; + + public KaChe(String infor, String number, int moneyPerDay, int heavy) { + super(infor, number, moneyPerDay); + this.heavy = heavy; + } + + public int getHeavy() { + return heavy; + } + + public void setHeavy(int heavy) { + this.heavy = heavy; + } + + @Override + public int discount() { + int dayAmount = getDayAmount(); + int totalMoney = getMoneyPerDay()*dayAmount*getHeavy(); + + return totalMoney; + } + + @Override + public String toString() { + return "KaChe [infor=" + getInfor() + ", number=" + getNumber() + ", moneyPerDay=" + getMoneyPerDay() + ", dayAmount=" + + getDayAmount() + "heavy=" + heavy + "]"; + } + + +} diff --git a/JavaSE/src/mine/thirtyTwo/carRentSystem/ProjectTest.java b/JavaSE/src/mine/thirtyTwo/carRentSystem/ProjectTest.java new file mode 100644 index 0000000..eaba7c8 --- /dev/null +++ b/JavaSE/src/mine/thirtyTwo/carRentSystem/ProjectTest.java @@ -0,0 +1,139 @@ +package mine.thirtyTwo.carRentSystem; +import java.awt.Menu; +import java.util.*; + +public class ProjectTest { + + public static void main(String[] args) { + // TODO Auto-generated method stub + + ArrayList list = createVehicle(); + Vehicle v; //用户选择的具体到哪一个的车 + + System.out.println("***********欢迎光临腾飞汽车租赁公司***********"); + System.out.printf("1、轿车\t2、客车\t3、卡车\n"); + System.out.print("请选择你要租赁的汽车类型: "); + Scanner in = new Scanner(System.in); + switch (in.nextInt()) { + case 1: + System.out.print("请选择你要租赁的汽车品牌:1、宝马 2、别克: "); + v = (Car)carMenu(in.nextInt(), list); + System.out.println("您需要支付的租赁费用是:"+totalMoney(v)); + break; + case 2: + System.out.print("请选择你要租赁的汽车品牌:1、金龙 2、金杯: "); + v = (Bus)busMenu(in.nextInt(), list); + System.out.println("您需要支付的租赁费用是:"+totalMoney(v)); + break; + case 3: + System.out.print("请选择你要租赁的汽车品牌:1、一汽解放 2、重庆红岩: "); + v = (KaChe)kaCheMenu(in.nextInt(), list); + System.out.println("您需要支付的租赁费用是:"+totalMoney(v)); + break; + default: + break; + } + } + + public static ArrayList createVehicle(){ + + ArrayList list = new ArrayList(); + list.add(new Car("宝马","京NY28588",800,"X6")); + list.add(new Car("宝马","京CNY3284",600,"550i")); + list.add(new Car("别克","京NT37465",300,"林荫大道")); + list.add(new Car("别克","京NT96968",600,"GL8")); + list.add(new Bus("金杯","京6566754",800,16)); + list.add(new Bus("金龙","京8696997",800,16)); + list.add(new Bus("金杯","京9696996",1500,34)); + list.add(new Bus("金龙","京8696998",1500,34)); + list.add(new KaChe("一汽解放", "京11111", 50, 1)); + list.add(new KaChe("重庆红岩", "京MH98725", 100, 1)); + list.add(new KaChe("一汽解放", "京22222", 50, 2)); + list.add(new KaChe("重庆红岩", "京MH33333", 100, 2)); + + return list; + } + + public static Vehicle carMenu(int i, ArrayList list){ + if(i==1){ + System.out.print("请选择你要租赁的汽车型号:1、X6 2、550i"); + Scanner in = new Scanner(System.in); + int choice = in.nextInt(); + if(choice==1){ + return list.get(0); + } + if(choice==2){ + return list.get(1); + } + }else if(i==2){ + System.out.print("请选择你要租赁的汽车型号:1、林荫大道 2、GL8"); + Scanner in = new Scanner(System.in); + int choice = in.nextInt(); + if(choice==1){ + return list.get(2); + } + if(choice==2){ + return list.get(3); + } + } + return null; + } + + public static Vehicle busMenu(int i, ArrayList list){ + if(i==1){ + System.out.print("请选择你要租赁的汽车座位:1、16座 2、34座"); + Scanner in = new Scanner(System.in); + int choice = in.nextInt(); + if(choice==1){ + return list.get(5); + } + if(choice==2){ + return list.get(7); + } + }else if(i == 2){ + System.out.print("请选择你要租赁的汽车座位:1、16座 2、34座"); + Scanner in = new Scanner(System.in); + int choice = in.nextInt(); + if(choice==1){ + return list.get(4); + } + if(choice==2){ + return list.get(6); + } + } + return null; + } + + public static Vehicle kaCheMenu(int i, ArrayList list){ + if(i==1){ + System.out.print("请选择你要租赁的汽车吨位:1、1t 2、2t"); + Scanner in = new Scanner(System.in); + int choice = in.nextInt(); + if(choice==1){ + return list.get(8); + } + if(choice==2){ + return list.get(10); + } + }else if(i==2){ + System.out.print("请选择你要租赁的汽车型号:1、1t 2、2t"); + Scanner in = new Scanner(System.in); + int choice = in.nextInt(); + if(choice==1){ + return list.get(9); + } + if(choice==2){ + return list.get(11); + } + } + return null; + } + + public static double totalMoney(Vehicle v){ + System.out.print("请输入您要租赁的天数为:"); + Scanner in = new Scanner(System.in); + v.setDayAmount(in.nextInt()); + System.out.println("分配给您的汽车牌号是:"+v.getNumber()); + return v.discount(); + } +} diff --git a/JavaSE/src/mine/thirtyTwo/carRentSystem/Vehicle.java b/JavaSE/src/mine/thirtyTwo/carRentSystem/Vehicle.java new file mode 100644 index 0000000..4ad64ea --- /dev/null +++ b/JavaSE/src/mine/thirtyTwo/carRentSystem/Vehicle.java @@ -0,0 +1,62 @@ +package mine.thirtyTwo.carRentSystem; + +public abstract class Vehicle { + private String infor; + private String number; + private int moneyPerDay; + private int dayAmount; + + + + public Vehicle() { + super(); + // TODO Auto-generated constructor stub + } + + public Vehicle(String infor, String number, int moneyPerDay) { + this.infor = infor; + this.number = number; + this.moneyPerDay = moneyPerDay; + } + + public String getInfor() { + return infor; + } + + public void setInfor(String infor) { + this.infor = infor; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public int getMoneyPerDay() { + return moneyPerDay; + } + + public void setMoneyPerDay(int moneyPerDay) { + this.moneyPerDay = moneyPerDay; + } + + public int getDayAmount() { + return dayAmount; + } + + public void setDayAmount(int dayAmount) { + this.dayAmount = dayAmount; + } + + + @Override + public String toString() { + return "Vehicle [infor=" + infor + ", number=" + number + ", moneyPerDay=" + moneyPerDay + ", dayAmount=" + + dayAmount + "]"; + } + + public abstract int discount(); +} diff --git a/JavaSE/src/mine/three/shuixianhuashu/ShuiXianHuaShu.java b/JavaSE/src/mine/three/shuixianhuashu/ShuiXianHuaShu.java new file mode 100644 index 0000000..19ed0dd --- /dev/null +++ b/JavaSE/src/mine/three/shuixianhuashu/ShuiXianHuaShu.java @@ -0,0 +1,22 @@ +package mine.three.shuixianhuashu; + +import java.util.Scanner; + +public class ShuiXianHuaShu { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("[100,1000)之间的所有水仙花数: "); + for(int i=100; i<1000; i++){ + int hundred = i/100; + int ten = i%100/10; + int one = i%100%10; + int number = (int) (Math.pow(hundred,3)+ Math.pow(ten,3) +Math.pow(one,3)); + if(number == i){ + System.out.print(i+" "); + } + } + + } + +} diff --git a/JavaSE/src/mine/twelve/hero/Assassin.java b/JavaSE/src/mine/twelve/hero/Assassin.java new file mode 100644 index 0000000..fc89cc0 --- /dev/null +++ b/JavaSE/src/mine/twelve/hero/Assassin.java @@ -0,0 +1,48 @@ +package mine.twelve.hero; + +public class Assassin extends Hero{ + private double blast; + + public Assassin() { + super(); + } + + public Assassin(String name, double gongJiLi, double fangYuLi, int price, double blast) { + super(name, gongJiLi, fangYuLi, price); + this.blast = blast; + } + + public double getBlast() { + return blast; + } + + public void setBlast(double blast) { + this.blast = blast; + + double money = hero(); + if(money>=5000&&money<10000){ + this.blast = this.blast*1002/1000; + }else if(money>=10000&&money<15000){ + this.blast = this.blast*1004/1000; + }else if(money>=15000&&money<20000){ + this.blast = this.blast*1006/1000; + }else if(money>=20000){ + this.blast = this.blast*1008/1000; + } + } + + @Override + public String show() { + return super.show()+" Assassin [getBlast()=" + getBlast() + ", hero()=" + hero() + "]"; + } + + @Override + public double hero() { + int money = 0; + //............ + if(money<5000){ + System.out.println("金币个数不足,请继续积攒"); + } + return 0; + } +} diff --git a/JavaSE/src/mine/twelve/hero/Hero.java b/JavaSE/src/mine/twelve/hero/Hero.java new file mode 100644 index 0000000..e2252eb --- /dev/null +++ b/JavaSE/src/mine/twelve/hero/Hero.java @@ -0,0 +1,58 @@ +package mine.twelve.hero; + +public abstract class Hero { + private String name; + private double gongJiLi; //攻击力 + private double fangYuLi; //防御力 + private int price; + + public Hero() { + + } + + public Hero(String name, double gongJiLi, double fangYuLi, int price) { + this.name = name; + this.gongJiLi = gongJiLi; + this.fangYuLi = fangYuLi; + this.price = price; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public double getGongJiLi() { + return gongJiLi; + } + + public void setGongJiLi(double gongJiLi) { + this.gongJiLi = gongJiLi; + } + + public double getFangYuLi() { + return fangYuLi; + } + + public void setFangYuLi(double fangYuLi) { + this.fangYuLi = fangYuLi; + } + + public int getPrice() { + return price; + } + + public void setPrice(int price) { + this.price = price; + } + + public String show(){ + return "Hero [getName()=" + getName() + ", getGongJiLi()=" + getGongJiLi() + ", getFangYuLi()=" + getFangYuLi() + + ", getPrice()=" + getPrice() + ", hero()=" + hero() + "]"; + } + + public abstract double hero(); +} diff --git a/JavaSE/src/mine/twelve/hero/Rabbi.java b/JavaSE/src/mine/twelve/hero/Rabbi.java new file mode 100644 index 0000000..d205df9 --- /dev/null +++ b/JavaSE/src/mine/twelve/hero/Rabbi.java @@ -0,0 +1,48 @@ +package mine.twelve.hero; + +public class Rabbi extends Hero{ + private double faLi;//法力 + + public Rabbi() { + super(); + } + + public Rabbi(String name, double gongJiLi, double fangYuLi, int price, double faLi) { + super(name, gongJiLi, fangYuLi, price); + this.faLi = faLi; + } + + public double getFaLi() { + return faLi; + } + + public void setFaLi(double faLi) { + this.faLi = faLi; + + double money = hero(); + if(money>=5000&&money<10000){ + this.faLi = this.faLi*2; + }else if(money>=10000&&money<15000){ + this.faLi = this.faLi*4; + }else if(money>=15000&&money<20000){ + this.faLi = this.faLi*6; + }else if(money>=20000){ + this.faLi = this.faLi*8; + } + } + + @Override + public String show() { + return super.show()+" Rabbi [getFaLi()=" + getFaLi() + ", hero()=" + hero() + "]"; + } + + @Override + public double hero() { + int money = 0; + //............ + if(money<5000){ + System.out.println("金币个数不足,请继续积攒"); + } + return 0; + } +} diff --git a/JavaSE/src/mine/twelve/hero/Shooter.java b/JavaSE/src/mine/twelve/hero/Shooter.java new file mode 100644 index 0000000..c47c91b --- /dev/null +++ b/JavaSE/src/mine/twelve/hero/Shooter.java @@ -0,0 +1,48 @@ +package mine.twelve.hero; + +public class Shooter extends Hero{ + private double speed; + + public Shooter() { + super(); + } + + public Shooter(String name, double gongJiLi, double fangYuLi, int price, double speed) { + super(name, gongJiLi, fangYuLi, price); + this.speed = speed; + } + + public double getSpeed() { + return speed; + } + + public void setSpeed(double speed) { + this.speed = speed; + + double money = hero(); + if(money>=5000&&money<10000){ + this.speed = this.speed*1002/1000; + }else if(money>=10000&&money<15000){ + this.speed = this.speed*1004/1000; + }else if(money>=15000&&money<20000){ + this.speed = this.speed*1006/1000; + }else if(money>=20000){ + this.speed = this.speed*1008/1000; + } + } + + @Override + public String show() { + return super.show()+" Shooter [getSpeed()=" + getSpeed() + ", hero()=" + hero() + "]"; + } + + @Override + public double hero() { + int money = 0; + //............ + if(money<5000){ + System.out.println("金币个数不足,请继续积攒"); + } + return 0; + } +} diff --git a/JavaSE/src/mine/twelve/hero/Warrior.java b/JavaSE/src/mine/twelve/hero/Warrior.java new file mode 100644 index 0000000..7b64460 --- /dev/null +++ b/JavaSE/src/mine/twelve/hero/Warrior.java @@ -0,0 +1,49 @@ +package mine.twelve.hero; + +public class Warrior extends Hero{ + private double blood; + + public Warrior() { + super(); + } + + public Warrior(String name, double gongJiLi, double fangYuLi, int price, double blood) { + super(name, gongJiLi, fangYuLi, price); + this.blood = blood; + } + + public double getBlood() { + return blood; + } + + public void setBlood(double blood) { + this.blood = blood; + + double money = hero(); + if(money>=5000&&money<10000){ + this.blood = this.blood*2; + }else if(money>=10000&&money<15000){ + this.blood = this.blood*4; + }else if(money>=15000&&money<20000){ + this.blood = this.blood*6; + }else if(money>=20000){ + this.blood = this.blood*8; + } + } + + @Override + public String show() { + return super.show()+" Warrior [getBlood()=" + getBlood() + ", hero()=" + hero() + "]"; + } + + @Override + public double hero() { + int money = 0; + //............ + if(money<5000){ + System.out.println("金币个数不足,请继续积攒"); + } + return 0; + } + +} diff --git a/JavaSE/src/mine/twentyEight/caipiao2/CaiPiao2.java b/JavaSE/src/mine/twentyEight/caipiao2/CaiPiao2.java new file mode 100644 index 0000000..123b0de --- /dev/null +++ b/JavaSE/src/mine/twentyEight/caipiao2/CaiPiao2.java @@ -0,0 +1,104 @@ +package mine.twentyEight.caipiao2; + +import java.util.HashSet; +import java.util.Scanner; +import java.util.Set; + +public class CaiPiao2 { + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("1.手选\t2.机打"); + Scanner in = new Scanner(System.in); + int hm = in.nextInt(); //hand 或者 machine + HashSet choice = null;//用来存7个数的Set + while(choice!=null){ + switch (hm) { + case 1: + choice = hand(); + break; + case 2: + choice = machine(); + break; + default: + break; + } + } + + System.out.println("开奖号码:"); + HashSet prizeCode = machine(); + Object[] code = prizeCode.toArray(); + for(int i=0; i=0&&(int)choiceArray[i]<2){ + flag = false; + System.out.println("很遗憾,奖励棒棒糖一个"); + }else if((int)choiceArray[i]>=2&&(int)choiceArray[i]<5){ + flag = false; + System.out.println("奖金1000元"); + }else if((int)choiceArray[i]>=5&&(int)choiceArray[i]<7){ + flag = false; + System.out.println("奖金5000元"); + } + } + } + if(flag){ + System.out.println("很遗憾,无任何奖励"); + } + } + + + } + /** + * 手选 + * @return HashSet + */ + public static HashSet hand(){ + HashSet a = new HashSet(); + Scanner in = new Scanner(System.in); + while(a.size()<7){ + System.out.printf("请输入第%d个数:\n", a.size()+1); + int number = in.nextInt(); + if(number<0||number>35){ + System.out.print("超出边界范围,请重新输入,"); + continue; + } + if(a.contains(number)){ + System.out.print("已重复,请重新输入,"); + continue; + } + a.add(number); + } + return a; + } + + /** + * 机选 + * @return HashSet + */ + public static HashSet machine(){ + HashSet a = new HashSet(); + while(a.size()<7){ + a.add((int) (Math.random()*35+1)); + } + return a; + } +} diff --git a/JavaSE/src/mine/twentyEight/caipiao2/Caipiao.java b/JavaSE/src/mine/twentyEight/caipiao2/Caipiao.java new file mode 100644 index 0000000..f6fa376 --- /dev/null +++ b/JavaSE/src/mine/twentyEight/caipiao2/Caipiao.java @@ -0,0 +1,66 @@ +package mine.twentyEight.caipiao2; + +import java.util.Scanner; +import java.util.TreeSet; + +public class Caipiao { + /** + * 随机生成集合,用于中奖号码和机选。 + * @param args + */ + public static void main(String[] args) { + // TODO Auto-generated method stub + + } + + public TreeSet createSet(){ + TreeSet set = new TreeSet(); + while(set.size()<7){ + set.add((int) (Math.random()*35+1)); + } + return set; + } + + public TreeSet handSet(Scanner sc){ + TreeSet set = new TreeSet(); + while(set.size()<7){//集合长度小于7,添加数据 + System.out.print("请输入1~35之间的数字:"); + int num = sc.nextInt(); + if(num>=1&&num<=35){ + set.add(num); + }else{ + System.out.println("数字超出范围。"); + } + } + return set; + } + + public void change(TreeSet set){ + TreeSet strSet = new TreeSet(); + StringBuffer sb = new StringBuffer(); + for(Integer it:set){ + if(it<=9){ + strSet.add(sb.append("0"+it).toString()); + }else{ + strSet.add(sb.append(it).toString()); + } + } + for(String s: strSet){ + System.out.println(s+" "); + } + } + + public void yesOrNo(TreeSet reSet, TreeSet set){ + Integer[] a = new Integer[7]; + Integer[] a1 = reSet.toArray(a); + Integer[] b = new Integer[7]; + Integer[] b1 = reSet.toArray(b); + int count=0; + for(int i=0;i city = new HashMap(); + city.put("辽宁省", new String[]{"沈阳","大连","锦州"}); + city.put("河北省", new String[]{"石家庄","保定","衡水"}); + city.put("null", new String[]{"北京","上海","天津","重庆"}); + + System.out.println("请输入一个省份:"); + Scanner in = new Scanner(System.in); + String a = in.next(); + String[] cities = city.get(a); + System.out.println(Arrays.toString(cities)); + } +} diff --git a/JavaSE/src/mine/twentySeven/caipiao/CaiPiao.java b/JavaSE/src/mine/twentySeven/caipiao/CaiPiao.java new file mode 100644 index 0000000..0d3f4b8 --- /dev/null +++ b/JavaSE/src/mine/twentySeven/caipiao/CaiPiao.java @@ -0,0 +1,21 @@ +package mine.twentySeven.caipiao; + +import java.util.HashSet; +import java.util.Set; + +public class CaiPiao { + + public static void main(String[] args) { + // TODO Auto-generated method stub + Set a = new HashSet(); + while(a.size()<7){ + a.add((int) (Math.random()*35+1)); + } + Integer[] b = new Integer[a.size()]; + a.toArray(b); + for(int i=0; ia[j+1]){ + int t = a[j]; + a[j] = a[j+1]; + a[j+1] = t; + } + } + } + //Arrays.sort(a); //普通 + + StringBuffer str3 = new StringBuffer(""); + for(int m=0; m keySet(); +int size(); +V remove(K k); +boolean remove(K k, V v); +public boolean containsKey(Object key); +public boolean containsValue(Object value); +V get(Object key); +boolean isEmpty(); +public void clear(); + +Iterator; +Iterator it = list/set.iterator(); +boolean hasNext(); +E next(); + +File: +public static String separator; +public boolean createNewFile() throws IOException; +public boolean mkdir()/mkdirs();//鍒涘缓鐢辨鎶借薄璺緞鍚嶅懡鍚嶇殑鐩綍銆//鍒涘缓鐢辨鎶借薄璺緞鍚嶅懡鍚嶇殑鐩綍锛屽寘鎷换浣曞繀闇浣嗕笉瀛樺湪鐨勭埗鐩綍銆 +public boolean delete(); +public File getAbsoluteFile(); +public String getAbsolutePath(); +public String getName(); +public int compareTo(File f); +public long length();//鑾峰彇鏂囦欢涓鍙风殑涓暟,杩斿洖鐢辨鎶借薄璺緞鍚嶈〃绀虹殑鏂囦欢鐨勯暱搴︺ +public File[] listFiles();//杩斿洖涓涓娊璞¤矾寰勫悕鏁扮粍锛岃〃绀虹敱璇ユ娊璞¤矾寰勫悕琛ㄧず鐨勭洰褰曚腑鐨勬枃浠躲 +public String[] list();//杩斿洖涓涓瓧绗︿覆鏁扮粍锛屽懡鍚嶇敱姝ゆ娊璞¤矾寰勫悕琛ㄧず鐨勭洰褰曚腑鐨勬枃浠跺拰鐩綍銆 +public boolean exists(); +public boolean isAbsolute(); +public boolean isDirectory(); +public boolean isFile(); +public boolean isHidden(); + +Reader锛//瀛楃 + FileReader: public int read(), + public int read(char[] buf) + BufferedReader: public int read(), + public int read(char[] buf, int off, int len), + String readLine() +Writer: //瀛楃 + FileWriter: public void write(char[] buf), + public void write(char[] buf, int beginIndex, int len), + public void write(String str), + public void write(String str, int beginIndex, int len) + BufferedWriter: public void write(int ch), + public void write(char[] buf, int off, int len), + public void write(String str, int off, int len), + public void newLine() +InputStream: //瀛楄妭 + FileInputStream: public int read(), + public int read(byte[] buf), + public int read(byte[] buf,int beginIndex,int len) + BufferedInputStream: public int read(), + public int read(byte[] buf,int beginIndex,int len) +OutputStream: //瀛楄妭 + FileOutputStream: public void write(int b), + public void write(byte[] buf), + public void write(byte[] buf,int beginIndex,int len) + BufferedOutputStream: public void write(int b), + public void write(byte[] buf,int beginIndex,int len) +InputStreamReader/OutputStreamWriter //杞崲娴 + +for(int i=1;iar[middle]){ + begin=middle+1; + }else{ + end=middle-1; + } + } + return -1; + } + +绾跨▼: + public class ThreadDemo { + public static void main(String[] args) { + /*鍚姩绾跨▼瑕佹寚瀹歴tart鏂规硶锛岃屼笉鏄痳un鏂规硶銆 + run鏂规硶鏄嚎绋嬭鎵ц鐨勪换鍔★紝褰撶嚎绋嬬殑start鏂规硶璋冪敤鍚庯紝杩涘叆runnable鐘舵侊紝涓鏃﹁幏鍙朿pu鏃堕棿锛宺un鏂规硶浼氳嚜鍔ㄨ皟鐢ㄣ*/ + //鏂规硶涓 + Thread t1 = new MyThread1(); + Thread t2 = new MyThread2(); + t1.start(); + t2.start();//涔熷彲鑳芥槸t2鍏堣繘鍏unning锛宼1涓瀹氬厛杩涘叆runnable鐘舵併 + //鏂规硶浜 + Runnable r3 = new MyRunnable1(); + Runnable r4 = new MyRunnable2(); + Thread t3 = new Thread(r3); + Thread t4 = new Thread(r4); + t3.start(); + t4.start(); + //鏂规硶涓 + Thread t5 = new Thread() { + public void run() { + for(int i=0;i<1000;i++) { + System.out.println("MyThread5"); + } + } + }; + t5.start(); + //鏂规硶鍥 + Runnable r6 = new Runnable() { + public void run() { + for(int i=0;i<1000;i++) { + System.out.println("MyRunnable6"); + } + } + }; + Thread t6 = new Thread(r6); + t6.start(); + } + } + public class MyThread1 extends Thread{//涔熷彲浠ユ槸ThreadDemo鐨勫唴閮ㄧ被 + public void run() { + for(int i=0;i<1000;i++) { + System.out.println("MyThread1"); + } + } + } + public class MyThread2 extends Thread{ + public void run() { + for(int i=0;i<1000;i++) { + System.out.println("MyThread2"); + } + } + } + public class MyRunnable1 implements Runnable{ + @Override + public void run() { + for(int i=0;i<1000;i++) { + System.out.println("MyRunnable1"); + } + } + } + public class MyRunnable2 implements Runnable{ + @Override + public void run() { + for(int i=0;i<1000;i++) { + System.out.println("MyRunnable2"); + } + } + } diff --git "a/JavaSE/src/note/Java\345\237\272\347\241\200~Java\351\253\230\347\272\247\346\243\200\346\265\213\351\242\230.docm" "b/JavaSE/src/note/Java\345\237\272\347\241\200~Java\351\253\230\347\272\247\346\243\200\346\265\213\351\242\230.docm" new file mode 100644 index 0000000..97a4b11 Binary files /dev/null and "b/JavaSE/src/note/Java\345\237\272\347\241\200~Java\351\253\230\347\272\247\346\243\200\346\265\213\351\242\230.docm" differ