├── .idea ├── .name ├── gradle.xml ├── copyright │ └── profiles_settings.xml ├── scopes │ └── scope_settings.xml ├── ant.xml ├── encodings.xml ├── vcs.xml ├── description.html ├── modules.xml ├── artifacts │ └── JavaFXApp.xml ├── misc.xml └── compiler.xml ├── hello ├── .idea │ ├── .name │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ ├── misc.xml │ └── compiler.xml ├── src │ ├── HelloWorld.java │ └── solutions │ │ └── BigHello.java └── hello.iml ├── .gitignore ├── Chapter3 ├── .idea │ ├── .name │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ ├── misc.xml │ └── compiler.xml ├── src │ ├── PetMaster.java │ ├── VideoGame.java │ ├── Fish.java │ ├── PlayStation4.java │ ├── Pet.java │ └── CreatePlayStation4Objects.java └── Chapter3.iml ├── Chapter4 ├── .idea │ ├── .name │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ ├── compiler.xml │ └── misc.xml ├── src │ ├── PetMaster.java │ ├── DoWhileDemo.java │ ├── Pet.java │ ├── BonusPoints.java │ ├── solutions │ │ ├── TemperatureConverter.java │ │ └── TemperatureConverter2.java │ ├── Fish.java │ ├── GradeInterpreter.java │ └── ReportCard.java └── Chapter4.iml ├── Chapter5 ├── .idea │ ├── .name │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ ├── misc.xml │ └── compiler.xml ├── src │ ├── pets │ │ ├── Talkative.java │ │ ├── Cat.java │ │ ├── Parrot.java │ │ ├── Fish.java │ │ ├── Dog.java │ │ ├── PetMaster.java │ │ └── Swimmable.java │ ├── solutions │ │ ├── pets │ │ │ ├── Talkative.java │ │ │ ├── Pet.java │ │ │ ├── PetMaster.java │ │ │ ├── Fish.java │ │ │ ├── Dog.java │ │ │ └── Swimmable.java │ │ └── lambdapets │ │ │ ├── Talkative.java │ │ │ ├── Pet.java │ │ │ └── PetMasterLambda.java │ ├── mylambdas │ │ ├── Talkative.java │ │ ├── Pet.java │ │ └── PetMasterLambda.java │ ├── calc │ │ ├── ArithmeticOperation.java │ │ ├── Calculator.java │ │ ├── CalculatorWithLambdas.java │ │ └── CalculatorWithAnonymousClasses.java │ └── abstractclasses │ │ ├── Dog.java │ │ └── Animal.java └── Chapter5.iml ├── Chapter6 ├── .idea │ ├── .name │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ ├── misc.xml │ └── compiler.xml ├── src │ ├── friends │ │ ├── ContactDetail.java │ │ ├── HashTableBrokenDemo.java │ │ ├── HashTableGenericsDemo.java │ │ └── HashTableDemo.java │ ├── CarMaster.java │ ├── pets │ │ ├── Fish.java │ │ └── FishTank.java │ ├── ArrayListDemo.java │ ├── solutions │ │ ├── MyContacts.java │ │ └── ContactDetail.java │ └── vehicles │ │ └── Car.java └── Chapter6.iml ├── HelloPet ├── .idea │ ├── .name │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ ├── misc.xml │ └── compiler.xml └── MyPet.iml ├── Chapter11 ├── .idea │ ├── .name │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ └── compiler.xml ├── abc.dat ├── src │ ├── iosamples │ │ ├── abc.dat │ │ ├── MyByteReader.java │ │ ├── MyByteWriter.java │ │ └── MyBufferedByteReader.java │ ├── PrintArguments.java │ ├── solution │ │ ├── Score.java │ │ └── ScoreManager.java │ ├── serialization │ │ ├── GameState.java │ │ └── GameStateManager.java │ └── niosamples │ │ ├── FileCopy.java │ │ ├── MyTextFileWriter.java │ │ ├── MyTextFileReader.java │ │ └── MyTextFileBufferedFileWriter.java ├── data │ └── scores.txt └── Chapter11.iml ├── Chapter12 ├── .idea │ ├── .name │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ └── compiler.xml ├── Chapter12.iml └── src │ ├── WebSiteReader.java │ └── FileDownload.java ├── Chapter8_bad ├── .idea │ ├── .name │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ ├── Chapter8.iml │ ├── misc.xml │ └── compiler.xml ├── Calculator │ ├── .idea │ │ ├── ant.xml │ │ ├── gradle.xml │ │ ├── copyright │ │ │ └── profiles_settings.xml │ │ ├── scopes │ │ │ └── scope_settings.xml │ │ ├── encodings.xml │ │ ├── vcs.xml │ │ ├── description.html │ │ ├── modules.xml │ │ ├── artifacts │ │ │ └── JavaFXApp.xml │ │ ├── misc.xml │ │ └── compiler.xml │ ├── src │ │ └── mycalculator │ │ │ ├── Controller.java │ │ │ └── Main.java │ └── Calculator.iml └── Signin │ ├── .idea │ ├── ant.xml │ ├── gradle.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── description.html │ ├── modules.xml │ ├── artifacts │ │ └── JavaFXApp.xml │ ├── misc.xml │ └── compiler.xml │ ├── Signin.iml │ └── src │ ├── signin │ ├── signin.css │ ├── BasicController.java │ ├── Controller.java │ ├── MainWithBinding.java │ ├── Main.java │ ├── BindingController.java │ ├── signin.fxml │ ├── signin_for_binding_sample.fxml │ ├── MainPureJava.java │ └── ControllerLongRunningThread.java │ └── treads │ ├── SingleThreadedDemo.java │ └── MultiThreadedDemo.java ├── Chapter8 ├── .idea │ ├── ant.xml │ ├── gradle.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── description.html │ ├── modules.xml │ ├── artifacts │ │ └── JavaFXApp.xml │ ├── misc.xml │ └── compiler.xml ├── src │ ├── mycalculator │ │ ├── Controller.java │ │ └── Main.java │ ├── signin │ │ ├── signin.css │ │ ├── BasicController.java │ │ ├── Controller.java │ │ ├── MainWithBinding.java │ │ ├── Main.java │ │ ├── BindingController.java │ │ ├── signin.fxml │ │ ├── signin_for_binding_sample.fxml │ │ ├── MainPureJava.java │ │ └── ControllerLongRunningThread.java │ └── treads │ │ ├── SingleThreadedDemo.java │ │ └── MultiThreadedDemo.java └── Chapter8.iml ├── PingPong ├── .idea │ ├── ant.xml │ ├── gradle.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── description.html │ ├── modules.xml │ ├── artifacts │ │ └── JavaFXApp.xml │ ├── misc.xml │ └── compiler.xml ├── src │ ├── enumSamples │ │ ├── Day.java │ │ ├── GameConstants.java │ │ └── GreetTheDay.java │ └── pong │ │ ├── PingPongController_v1.java │ │ ├── PingPong.java │ │ ├── pingpong.fxml │ │ ├── PingPongController_v2.java │ │ ├── PingPongController_v3.java │ │ ├── PingPongController_v4.java │ │ ├── PingPongController_v5.java │ │ └── PingPongController_v6.java └── PingPong.iml ├── src └── sample │ ├── Controller.java │ ├── sample.fxml │ └── Main.java ├── TicTacToe ├── .idea │ ├── ant.xml │ ├── gradle.xml │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── description.html │ ├── modules.xml │ ├── artifacts │ │ └── JavaFXApp.xml │ ├── misc.xml │ └── compiler.xml ├── TicTacToe.iml └── src │ └── mygame │ ├── tictactoe.css │ ├── TicTacToe.java │ └── tictactoe.fxml ├── Chapter7 ├── Signin │ ├── src │ │ └── signin │ │ │ ├── Controller.java │ │ │ ├── signin.css │ │ │ ├── Main.java │ │ │ └── signin.fxml │ ├── .idea │ │ ├── ant.xml │ │ ├── gradle.xml │ │ ├── copyright │ │ │ └── profiles_settings.xml │ │ ├── scopes │ │ │ └── scope_settings.xml │ │ ├── encodings.xml │ │ ├── vcs.xml │ │ ├── description.html │ │ ├── modules.xml │ │ ├── artifacts │ │ │ └── JavaFXApp.xml │ │ ├── misc.xml │ │ └── compiler.xml │ └── Signin.iml ├── sample │ ├── src │ │ └── sample │ │ │ ├── Controller.java │ │ │ ├── Main.java │ │ │ └── sample.fxml │ ├── .idea │ │ ├── ant.xml │ │ ├── gradle.xml │ │ ├── copyright │ │ │ └── profiles_settings.xml │ │ ├── scopes │ │ │ └── scope_settings.xml │ │ ├── encodings.xml │ │ ├── vcs.xml │ │ ├── description.html │ │ ├── modules.xml │ │ ├── artifacts │ │ │ └── JavaFXApp.xml │ │ ├── misc.xml │ │ └── compiler.xml │ └── Chapter7.iml ├── Calculator │ ├── .idea │ │ ├── ant.xml │ │ ├── gradle.xml │ │ ├── copyright │ │ │ └── profiles_settings.xml │ │ ├── scopes │ │ │ └── scope_settings.xml │ │ ├── encodings.xml │ │ ├── vcs.xml │ │ ├── description.html │ │ ├── modules.xml │ │ ├── artifacts │ │ │ └── JavaFXApp.xml │ │ ├── misc.xml │ │ └── compiler.xml │ ├── src │ │ └── mycalculator │ │ │ ├── Controller.java │ │ │ └── Main.java │ └── Calculator.iml └── .idea │ ├── copyright │ └── profiles_settings.xml │ ├── scopes │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── modules.xml │ ├── misc.xml │ ├── artifacts │ └── JavaFXApp.xml │ └── compiler.xml ├── Signin ├── .idea │ ├── copyright │ │ └── profiles_settings.xml │ ├── scopes │ │ └── scope_settings.xml │ └── artifacts │ │ └── JavaFXApp.xml └── Signin.iml └── jfk.iml /.idea/.name: -------------------------------------------------------------------------------- 1 | jfk -------------------------------------------------------------------------------- /hello/.idea/.name: -------------------------------------------------------------------------------- 1 | hello -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | out -------------------------------------------------------------------------------- /Chapter3/.idea/.name: -------------------------------------------------------------------------------- 1 | Chapter3 -------------------------------------------------------------------------------- /Chapter4/.idea/.name: -------------------------------------------------------------------------------- 1 | Chapter4 -------------------------------------------------------------------------------- /Chapter5/.idea/.name: -------------------------------------------------------------------------------- 1 | Chapter5 -------------------------------------------------------------------------------- /Chapter6/.idea/.name: -------------------------------------------------------------------------------- 1 | Chapter6 -------------------------------------------------------------------------------- /HelloPet/.idea/.name: -------------------------------------------------------------------------------- 1 | HelloPet -------------------------------------------------------------------------------- /Chapter11/.idea/.name: -------------------------------------------------------------------------------- 1 | Chapter11 -------------------------------------------------------------------------------- /Chapter12/.idea/.name: -------------------------------------------------------------------------------- 1 | Chapter12 -------------------------------------------------------------------------------- /Chapter8_bad/.idea/.name: -------------------------------------------------------------------------------- 1 | Chapter8 -------------------------------------------------------------------------------- /Chapter11/abc.dat: -------------------------------------------------------------------------------- 1 | This is a test file -------------------------------------------------------------------------------- /Chapter11/src/iosamples/abc.dat: -------------------------------------------------------------------------------- 1 | This is a test file -------------------------------------------------------------------------------- /Chapter11/data/scores.txt: -------------------------------------------------------------------------------- 1 | My game score is 28000 2015-01-11T16:24:36.324 2 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Chapter8/.idea/ant.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /PingPong/.idea/ant.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/sample/Controller.java: -------------------------------------------------------------------------------- 1 | package sample; 2 | 3 | public class Controller { 4 | } 5 | -------------------------------------------------------------------------------- /Chapter8/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /PingPong/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /TicTacToe/.idea/ant.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /TicTacToe/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Chapter7/Signin/src/signin/Controller.java: -------------------------------------------------------------------------------- 1 | package signin; 2 | 3 | public class Controller { 4 | } 5 | -------------------------------------------------------------------------------- /Chapter7/sample/src/sample/Controller.java: -------------------------------------------------------------------------------- 1 | package sample; 2 | 3 | public class Controller { 4 | } 5 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/ant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/ant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter8/src/mycalculator/Controller.java: -------------------------------------------------------------------------------- 1 | package mycalculator; 2 | 3 | public class Controller { 4 | } 5 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/ant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/ant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/ant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter7/Calculator/src/mycalculator/Controller.java: -------------------------------------------------------------------------------- 1 | package mycalculator; 2 | 3 | public class Controller { 4 | } 5 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/src/mycalculator/Controller.java: -------------------------------------------------------------------------------- 1 | package mycalculator; 2 | 3 | public class Controller { 4 | } 5 | -------------------------------------------------------------------------------- /Chapter3/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter4/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter5/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter6/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter7/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter8/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /HelloPet/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /PingPong/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Signin/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /hello/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter11/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter12/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter8_bad/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /TicTacToe/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter5/src/pets/Talkative.java: -------------------------------------------------------------------------------- 1 | package pets; 2 | 3 | /** 4 | * Created by yfain11 on 8/13/14. 5 | */ 6 | public interface Talkative { 7 | public void talk(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Signin/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /hello/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter11/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter12/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter3/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter4/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter5/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter6/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter7/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter8/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /HelloPet/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /PingPong/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /TicTacToe/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter8_bad/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/ant.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter11/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter11/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter12/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Chapter12/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /Chapter5/src/solutions/pets/Talkative.java: -------------------------------------------------------------------------------- 1 | package solutions.pets; 2 | 3 | /** 4 | * Created by yfain11 on 8/13/14. 5 | */ 6 | public interface Talkative { 7 | public void talk(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /hello/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /hello/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided. 2 | -------------------------------------------------------------------------------- /Chapter3/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter3/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter4/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter4/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter5/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter5/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter5/src/mylambdas/Talkative.java: -------------------------------------------------------------------------------- 1 | package mylambdas; 2 | 3 | /** 4 | * Created by yfain11 on 8/13/14. 5 | */ 6 | public interface Talkative { 7 | public String talk(String petName); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Chapter6/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter6/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter7/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter7/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter8/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter8/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter8_bad/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /HelloPet/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /HelloPet/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PingPong/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /PingPong/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TicTacToe/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /TicTacToe/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter8/.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided. 2 | -------------------------------------------------------------------------------- /Chapter8_bad/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PingPong/.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided. 2 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TicTacToe/.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided. 2 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided. 2 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided. 2 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided. 2 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided. 2 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/description.html: -------------------------------------------------------------------------------- 1 | Simple JavaFX 2.0 application that includes simple .fxml file with attached controller and Main class to quick start. Artifact to build JavaFX application is provided. 2 | -------------------------------------------------------------------------------- /Chapter5/src/solutions/lambdapets/Talkative.java: -------------------------------------------------------------------------------- 1 | package solutions.lambdapets; 2 | 3 | /** 4 | * Created by yfain11 on 8/13/14. 5 | */ 6 | public interface Talkative { 7 | public String talk(String petName); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /PingPong/src/enumSamples/Day.java: -------------------------------------------------------------------------------- 1 | package enumSamples; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public enum Day { 7 | SUNDAY, MONDAY, TUESDAY, WEDNESDAY, 8 | THURSDAY, FRIDAY, SATURDAY 9 | } 10 | -------------------------------------------------------------------------------- /hello/src/HelloWorld.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | public class HelloWorld { 5 | 6 | public static void main(String[] args){ 7 | System.out.println("HelloWorld!"); 8 | } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /Chapter5/src/pets/Cat.java: -------------------------------------------------------------------------------- 1 | package pets; 2 | 3 | /** 4 | * Created by yfain11 on 8/13/14. 5 | */ 6 | public class Cat implements Talkative { 7 | public void talk(){ 8 | System.out.println("Meow! Meow!"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Chapter5/src/calc/ArithmeticOperation.java: -------------------------------------------------------------------------------- 1 | package calc; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public interface ArithmeticOperation { 7 | 8 | public double performOperation(double first, double second); 9 | } 10 | -------------------------------------------------------------------------------- /Chapter5/src/pets/Parrot.java: -------------------------------------------------------------------------------- 1 | package pets; 2 | 3 | /** 4 | * Created by yfain11 on 8/13/14. 5 | */ 6 | public class Parrot implements Talkative { 7 | public void talk(){ 8 | System.out.println("My name is Kesha."); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Chapter6/src/friends/ContactDetail.java: -------------------------------------------------------------------------------- 1 | package friends; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class ContactDetail { 7 | String fullName; 8 | String facebookID; 9 | String phone; 10 | String email; 11 | } 12 | -------------------------------------------------------------------------------- /Chapter5/src/abstractclasses/Dog.java: -------------------------------------------------------------------------------- 1 | package abstractclasses; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class Dog extends Animal{ 7 | public void talk(){ 8 | 9 | System.out.println("Bark! Bark-bark!"); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter11/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter12/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter8/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PingPong/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TicTacToe/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter5/src/solutions/pets/Pet.java: -------------------------------------------------------------------------------- 1 | package solutions.pets; 2 | 3 | import solutions.lambdapets.Talkative; 4 | 5 | /** 6 | * Created by NewProgrammer on 3/28/15. 7 | */ 8 | public class Pet { 9 | 10 | String name; 11 | 12 | Pet(String name){ 13 | this.name = name; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /hello/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /HelloPet/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter3/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter4/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter5/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter6/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/sample/sample.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter8_bad/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /HelloPet/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter5/src/pets/Fish.java: -------------------------------------------------------------------------------- 1 | package pets; 2 | 3 | /** 4 | * Created by yfain11 on 8/13/14. 5 | */ 6 | public class Fish implements Swimmable { 7 | public void swim(int howFar){ 8 | System.out.println("OK, will swim " + howFar + " feet"); 9 | } 10 | public void dive(int howDeep){ 11 | System.out.println("OK, will dive " + howDeep + " feet"); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Chapter5/src/pets/Dog.java: -------------------------------------------------------------------------------- 1 | package pets; 2 | 3 | /** 4 | * Created by yfain11 on 8/13/14. 5 | */ 6 | public class Dog implements Talkative, Swimmable { 7 | public void talk(){ 8 | System.out.println("Bark! Bark-bark!"); 9 | } 10 | 11 | public void swim(int howFar){ 12 | System.out.println("Will swim about a half of this distance: " + howFar/2 + " feet"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Chapter8_bad/.idea/Chapter8.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Chapter6/src/CarMaster.java: -------------------------------------------------------------------------------- 1 | import vehicles.Car; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class CarMaster { 7 | public static void main(String[] args) { 8 | 9 | Car myCar = new Car(); 10 | 11 | Object myOtherCar = new Car(); 12 | 13 | Car myOtherCarAfterCasting = (Car) myOtherCar; 14 | 15 | // myOtherCarAfterCasting. 16 | 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter11/src/PrintArguments.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | public class PrintArguments { 5 | 6 | public static void main(String[] args) { 7 | 8 | // How many arguments we've got? 9 | int numberOfArgs = args.length; 10 | 11 | for (int i=0; i 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Chapter6/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Chapter3/src/PetMaster.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | public class PetMaster { 5 | 6 | public static void main(String[] args) { 7 | 8 | String petReaction; 9 | 10 | Pet myPet = new Pet(); 11 | 12 | myPet.eat(); 13 | 14 | petReaction = myPet.talk("Tweet!! Tweet!!"); 15 | 16 | System.out.println(petReaction); 17 | 18 | myPet.sleep(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter4/src/PetMaster.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | public class PetMaster { 5 | 6 | public static void main(String[] args) { 7 | 8 | String petReaction; 9 | 10 | Pet myPet = new Pet(); 11 | 12 | myPet.eat(); 13 | 14 | petReaction = myPet.talk("Tweet!! Tweet!!"); 15 | 16 | System.out.println(petReaction); 17 | 18 | myPet.sleep(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter5/src/pets/PetMaster.java: -------------------------------------------------------------------------------- 1 | package pets; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class PetMaster { 7 | public static void main(String[] args) { 8 | 9 | Dog myDog = new Dog(); 10 | myDog.talk(); 11 | myDog.swim(7); 12 | myDog.dive(2); 13 | 14 | Fish myFish = new Fish(); 15 | myFish.swim(50); 16 | myFish.dive(20); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Chapter7/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Chapter3/src/VideoGame.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | class VideoGame { 5 | 6 | String color; 7 | int price; 8 | 9 | void start () { 10 | // The code to start the game goes here 11 | } 12 | 13 | void stop () { 14 | // The code to stop the game goes here 15 | } 16 | 17 | void saveScore(String playerName, int score) { 18 | // The code to save score goes here 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter5/src/solutions/lambdapets/Pet.java: -------------------------------------------------------------------------------- 1 | package solutions.lambdapets; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class Pet { 7 | 8 | String name; 9 | Talkative myTalkingRules; 10 | 11 | Pet(Talkative talkRules, String name){ 12 | this.name = name; 13 | myTalkingRules = talkRules; 14 | } 15 | 16 | public String speakup(){ 17 | 18 | return myTalkingRules.talk(name); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Chapter5/src/solutions/pets/PetMaster.java: -------------------------------------------------------------------------------- 1 | package solutions.pets; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class PetMaster { 7 | public static void main(String[] args) { 8 | 9 | Dog myDog = new Dog("Sammy"); 10 | myDog.talk(); 11 | myDog.swim(7); 12 | myDog.dive(2); 13 | 14 | Fish myFish = new Fish("Mary"); 15 | myFish.swim(50); 16 | myFish.dive(20); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jfk.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter11/Chapter11.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Chapter12/Chapter12.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /PingPong/src/enumSamples/GameConstants.java: -------------------------------------------------------------------------------- 1 | package enumSamples; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public enum GameConstants { 7 | 8 | TABLE_WIDTH(320),TABLE_HEIGHT(220), KID_RACKET_Y_START(100), 9 | KID_RACKET_X_START(300),TABLE_TOP(12), TABLE_BOTTOM(180),RACKET_INCREMENT(4); 10 | 11 | private int value; 12 | 13 | private GameConstants(int value){ 14 | this.value=value; 15 | }; 16 | 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /PingPong/src/pong/PingPongController_v1.java: -------------------------------------------------------------------------------- 1 | package pong; 2 | 3 | import javafx.scene.input.KeyCode; 4 | import javafx.scene.input.KeyEvent; 5 | 6 | // This version of the controller just prints the code of the pressed key on the console 7 | 8 | public class PingPongController_v1 { 9 | 10 | public void keyReleasedHandler(KeyEvent event){ 11 | 12 | KeyCode keyCode = event.getCode(); 13 | System.out.println("You pressed " + keyCode); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Signin/Signin.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /hello/hello.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter3/Chapter3.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter4/Chapter4.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter5/Chapter5.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter6/Chapter6.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter8/Chapter8.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /HelloPet/MyPet.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /PingPong/PingPong.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter3/src/Fish.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | public class Fish extends Pet { 5 | 6 | int currentDepth=0; 7 | 8 | public int dive(int howDeep){ 9 | 10 | currentDepth=currentDepth + howDeep; 11 | System.out.println("Diving for " + 12 | howDeep + " feet"); 13 | System.out.println("I'm at " + currentDepth + 14 | " feet below sea level"); 15 | 16 | return currentDepth; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter5/src/abstractclasses/Animal.java: -------------------------------------------------------------------------------- 1 | package abstractclasses; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public abstract class Animal { 7 | 8 | String animalClass; 9 | String name; 10 | 11 | public void setName(String name){ 12 | this.name = name; 13 | } 14 | 15 | public void sleep(){ 16 | System.out.println("The " + name + " is tired and goes to sleep."); 17 | } 18 | 19 | abstract public void talk(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Chapter7/Signin/Signin.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /TicTacToe/TicTacToe.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /TicTacToe/src/mygame/tictactoe.css: -------------------------------------------------------------------------------- 1 | .button{ 2 | -fx-focus-color: transparent; 3 | -fx-background-insets: -1, 0, 1, 1; 4 | 5 | -fx-font-weight: bold; 6 | -fx-font-size: 36; 7 | -fx-text-fill: blue; 8 | -fx-background-color: violet; 9 | -fx-border-color:darkblue; 10 | } 11 | 12 | .menu-bar{ 13 | -fx-background-color: gold; 14 | } 15 | 16 | .winning-square { 17 | -fx-background-color: radial-gradient( radius 100%, white, lightyellow, lawngreen); 18 | -fx-text-fill: red; 19 | } -------------------------------------------------------------------------------- /Chapter7/sample/Chapter7.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter8/src/signin/signin.css: -------------------------------------------------------------------------------- 1 | #submitBtn{ 2 | -fx-background-color: lightskyblue; 3 | -fx-font-family:verdana; 4 | -fx-font-size:20; 5 | -fx-font-weight: bold; 6 | -fx-stroke:navy; 7 | -fx-font-style:italic; 8 | -fx-border-radius: 20; 9 | -fx-background-radius: 20; 10 | -fx-padding: 5; 11 | } 12 | 13 | .label{ 14 | -fx-text-fill: red; 15 | } 16 | 17 | .bluelabel{ 18 | -fx-text-fill: blue; 19 | -fx-font-family:verdana; 20 | -fx-font-style:italic; 21 | } -------------------------------------------------------------------------------- /Chapter8_bad/Signin/Signin.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter7/Calculator/Calculator.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter7/Signin/src/signin/signin.css: -------------------------------------------------------------------------------- 1 | #submitBtn{ 2 | -fx-background-color: lightskyblue; 3 | -fx-font-family:verdana; 4 | -fx-font-size:20; 5 | -fx-font-weight: bold; 6 | -fx-stroke:navy; 7 | -fx-font-style:italic; 8 | -fx-border-radius: 20; 9 | -fx-background-radius: 20; 10 | -fx-padding: 5; 11 | } 12 | 13 | .label{ 14 | -fx-text-fill: red; 15 | } 16 | 17 | .bluelabel{ 18 | -fx-text-fill: blue; 19 | -fx-font-family:verdana; 20 | -fx-font-style:italic; 21 | } -------------------------------------------------------------------------------- /Chapter8/src/treads/SingleThreadedDemo.java: -------------------------------------------------------------------------------- 1 | package treads; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class SingleThreadedDemo { 7 | public static void main(String[] args) { 8 | 9 | for (int i=0; i<5;i++){ 10 | System.out.println("The value of i in power of 4 is " + i*i*i*i*i); 11 | } 12 | 13 | for (int k=0; k<5;k++){ 14 | System.out.println("*** The value of k is " + k + "!"); 15 | } 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter5/src/mylambdas/Pet.java: -------------------------------------------------------------------------------- 1 | package mylambdas; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class Pet { 7 | 8 | 9 | // Arguments: rules for talking and pet's name 10 | // Return: What did the pet say 11 | public String speakup(Talkative talkRules, String name){ 12 | return talkRules.talk(name); 13 | } 14 | 15 | static public String saySomething(Talkative talkRules, String name){ 16 | return talkRules.talk(name); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/Calculator.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/src/signin/signin.css: -------------------------------------------------------------------------------- 1 | #submitBtn{ 2 | -fx-background-color: lightskyblue; 3 | -fx-font-family:verdana; 4 | -fx-font-size:20; 5 | -fx-font-weight: bold; 6 | -fx-stroke:navy; 7 | -fx-font-style:italic; 8 | -fx-border-radius: 20; 9 | -fx-background-radius: 20; 10 | -fx-padding: 5; 11 | } 12 | 13 | .label{ 14 | -fx-text-fill: red; 15 | } 16 | 17 | .bluelabel{ 18 | -fx-text-fill: blue; 19 | -fx-font-family:verdana; 20 | -fx-font-style:italic; 21 | } -------------------------------------------------------------------------------- /Chapter8/src/signin/BasicController.java: -------------------------------------------------------------------------------- 1 | package signin; 2 | 3 | import javafx.event.ActionEvent; 4 | import javafx.scene.input.MouseEvent; 5 | 6 | 7 | public class BasicController { 8 | 9 | public void signInClicked(ActionEvent evt){ 10 | 11 | System.out.println("Hello from signInClicked method in controller"); 12 | } 13 | 14 | public void signInMouseClicked(MouseEvent evt){ 15 | 16 | System.out.println("Hello from signInMouseClicked method in controller"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/src/treads/SingleThreadedDemo.java: -------------------------------------------------------------------------------- 1 | package treads; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class SingleThreadedDemo { 7 | public static void main(String[] args) { 8 | 9 | for (int i=0; i<5;i++){ 10 | System.out.println("The value of i in power of 4 is " + i*i*i*i*i); 11 | } 12 | 13 | for (int k=0; k<5;k++){ 14 | System.out.println("*** The value of k is " + k + "!"); 15 | } 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Chapter7/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/src/signin/BasicController.java: -------------------------------------------------------------------------------- 1 | package signin; 2 | 3 | import javafx.event.ActionEvent; 4 | import javafx.scene.input.MouseEvent; 5 | 6 | 7 | public class BasicController { 8 | 9 | public void signInClicked(ActionEvent evt){ 10 | 11 | System.out.println("Hello from signInClicked method in controller"); 12 | } 13 | 14 | public void signInMouseClicked(MouseEvent evt){ 15 | 16 | System.out.println("Hello from signInMouseClicked method in controller"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /hello/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Chapter5/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Chapter11/src/solution/Score.java: -------------------------------------------------------------------------------- 1 | package solution; 2 | 3 | import java.io.Serializable; 4 | import java.time.LocalDateTime; 5 | 6 | class Score implements Serializable { 7 | String name; 8 | int score; 9 | LocalDateTime dateTime; 10 | 11 | Score(String name, int score, LocalDateTime dateTime){ 12 | this.name=name; 13 | this.score=score; 14 | this.dateTime=dateTime; 15 | } 16 | 17 | public String toString(){ 18 | return name + " scored " + score + " on " + dateTime; 19 | } 20 | } -------------------------------------------------------------------------------- /Chapter5/src/solutions/pets/Fish.java: -------------------------------------------------------------------------------- 1 | package solutions.pets; 2 | 3 | import pets.Swimmable; 4 | 5 | /** 6 | * Created by yfain11 on 8/13/14. 7 | */ 8 | public class Fish extends Pet implements Swimmable { 9 | 10 | Fish(String name) { 11 | super(name); 12 | } 13 | public void swim(int howFar){ 14 | System.out.println("OK," + name + " will swim " + howFar + " feet"); 15 | } 16 | public void dive(int howDeep){ 17 | System.out.println("OK, " + name + " will dive " + howDeep + " feet"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Signin/.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Chapter7/.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter8/.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /PingPong/.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /TicTacToe/.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter8/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /PingPong/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /TicTacToe/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/artifacts/JavaFXApp.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/JavaFXApp 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Chapter4/src/DoWhileDemo.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class DoWhileDemo { 7 | public static void main(String[] args) { 8 | 9 | String playAgain = "no"; 10 | 11 | Scanner usersConsole = new Scanner(System.in); 12 | 13 | do{ 14 | System.out.print("Do you want to play again (yes/no)? "); 15 | playAgain = usersConsole.nextLine(); 16 | 17 | } while ("yes".equals(playAgain)); 18 | 19 | System.out.println("Thank you for playing!"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Chapter5/src/solutions/pets/Dog.java: -------------------------------------------------------------------------------- 1 | package solutions.pets; 2 | 3 | import pets.Swimmable; 4 | import pets.Talkative; 5 | 6 | /** 7 | * Created by yfain11 on 8/13/14. 8 | */ 9 | public class Dog extends Pet implements Talkative, Swimmable { 10 | 11 | Dog(String name) { 12 | super(name); 13 | } 14 | public void talk(){ 15 | System.out.println( "My name is " + name + " Bark-bark-bark!"); 16 | } 17 | 18 | public void swim(int howFar){ 19 | System.out.println(name + " will swim about a half of this distance: " + howFar/2 + " feet"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chapter3/src/PlayStation4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | class PlayStation4 extends VideoGame{ 5 | 6 | String hardDiskSize; 7 | 8 | // Some other attributes and methods go here 9 | 10 | void shareOnFacebook(){ 11 | // Code to share on Facebook go here 12 | System.out.println("Hey, Facebook, I got PlayStation4 with " + hardDiskSize); 13 | } 14 | 15 | void shareOnTwitter(){ 16 | // Code to share on Twitter go here 17 | System.out.println("Hey, Twitter, I got PlayStation4 with " + hardDiskSize); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Chapter3/src/Pet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | public class Pet { 5 | 6 | int age; 7 | float weight; 8 | float height; 9 | String color; 10 | 11 | public void sleep(){ 12 | System.out.println( 13 | "Good night, see you tomorrow!"); 14 | } 15 | 16 | public void eat(){ 17 | System.out.println( 18 | "I’m so hungry, let me have a snack like nachos!"); 19 | } 20 | 21 | public String talk(String aWord){ 22 | String petResponse = "OK!! OK!! " +aWord; 23 | return petResponse; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Chapter4/src/Pet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | public class Pet { 5 | 6 | int age; 7 | float weight; 8 | float height; 9 | String color; 10 | 11 | public void sleep(){ 12 | System.out.println( 13 | "Good night, see you tomorrow!"); 14 | } 15 | 16 | public void eat(){ 17 | System.out.println( 18 | "I’m so hungry, let me have a snack like nachos!"); 19 | } 20 | 21 | public String talk(String aWord){ 22 | String petResponse = "OK!! OK!! " +aWord; 23 | return petResponse; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Chapter8/src/treads/MultiThreadedDemo.java: -------------------------------------------------------------------------------- 1 | package treads; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class MultiThreadedDemo { 7 | public static void main(String[] args) { 8 | 9 | Thread myThread = new Thread( 10 | () ->{ 11 | for (int i=0; i<5;i++){ 12 | System.out.println("The value of i in power of 4 is " + i*i*i*i*i); 13 | } 14 | } 15 | ); 16 | 17 | myThread.start(); 18 | 19 | for (int k=0; k<5;k++){ 20 | System.out.println("*** The value of k is " + k + "!"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /hello/src/solutions/BigHello.java: -------------------------------------------------------------------------------- 1 | package solutions; 2 | 3 | /** 4 | * Created by yfain11 on 3/31/14. 5 | */ 6 | public class BigHello { 7 | 8 | public static void main(String[] args) { 9 | System.out.println("\n"); // an end of line character to print empty line 10 | System.out.println("* * ***** * * ****"); 11 | System.out.println("* * * * * * *"); 12 | System.out.println("****** ***** * * * *"); 13 | System.out.println("* * * * * * *"); 14 | System.out.println("* * ***** ***** ***** **** "); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/src/treads/MultiThreadedDemo.java: -------------------------------------------------------------------------------- 1 | package treads; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class MultiThreadedDemo { 7 | public static void main(String[] args) { 8 | 9 | Thread myThread = new Thread( 10 | () ->{ 11 | for (int i=0; i<5;i++){ 12 | System.out.println("The value of i in power of 4 is " + i*i*i*i*i); 13 | } 14 | } 15 | ); 16 | 17 | myThread.start(); 18 | 19 | for (int k=0; k<5;k++){ 20 | System.out.println("*** The value of k is " + k + "!"); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Chapter11/src/iosamples/MyByteReader.java: -------------------------------------------------------------------------------- 1 | package iosamples; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.IOException; 5 | public class MyByteReader { 6 | 7 | public static void main(String[] args) { 8 | 9 | try (FileInputStream myFile = new FileInputStream("abc.dat")){ 10 | 11 | int byteValue; 12 | 13 | while ((byteValue = myFile.read()) != -1) { 14 | 15 | System.out.print(byteValue + " "); 16 | } 17 | } catch (IOException ioe) { 18 | System.out.println("Could not read file: " + 19 | ioe.getMessage()); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /src/sample/Main.java: -------------------------------------------------------------------------------- 1 | package sample; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class Main extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("sample.fxml")); 14 | primaryStage.setTitle("Hello World"); 15 | primaryStage.setScene(new Scene(root, 300, 275)); 16 | primaryStage.show(); 17 | } 18 | 19 | 20 | public static void main(String[] args) { 21 | launch(args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Chapter7/sample/src/sample/Main.java: -------------------------------------------------------------------------------- 1 | package sample; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class Main extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("sample.fxml")); 14 | primaryStage.setTitle("Hello World"); 15 | primaryStage.setScene(new Scene(root, 300, 275)); 16 | primaryStage.show(); 17 | } 18 | 19 | 20 | public static void main(String[] args) { 21 | launch(args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Chapter3/src/CreatePlayStation4Objects.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | public class CreatePlayStation4Objects { 5 | 6 | public static void main(String[] args) { 7 | 8 | // create one instance of PlayStation4 class 9 | PlayStation4 firstPlayStation = new PlayStation4(); 10 | firstPlayStation.hardDiskSize = "500GB"; 11 | 12 | // call the method shareOnFacebook 13 | firstPlayStation.shareOnFacebook(); 14 | 15 | PlayStation4 secondPlayStation = new PlayStation4(); 16 | secondPlayStation.hardDiskSize = "1TB"; 17 | 18 | // call the method shareOnTwitter 19 | secondPlayStation.shareOnTwitter(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Chapter6/src/pets/Fish.java: -------------------------------------------------------------------------------- 1 | package pets; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class Fish { 7 | private float weight; 8 | private String color; 9 | 10 | Fish(float weight, String color){ 11 | this.setWeight(weight); 12 | this.setColor(color); 13 | } 14 | 15 | // getters and setters 16 | 17 | public float getWeight() { 18 | return weight; 19 | } 20 | 21 | public void setWeight(float weight) { 22 | this.weight = weight; 23 | } 24 | 25 | public String getColor() { 26 | return color; 27 | } 28 | 29 | public void setColor(String color) { 30 | this.color = color; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Chapter8/src/mycalculator/Main.java: -------------------------------------------------------------------------------- 1 | package mycalculator; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class Main extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("calculator.fxml")); 14 | primaryStage.setTitle("My JavaFX Calculator"); 15 | primaryStage.setScene(new Scene(root, 650, 600)); 16 | primaryStage.show(); 17 | } 18 | 19 | 20 | public static void main(String[] args) { 21 | launch(args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /PingPong/src/enumSamples/GreetTheDay.java: -------------------------------------------------------------------------------- 1 | package enumSamples; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class GreetTheDay { 7 | 8 | public static void main(String[] args) { 9 | 10 | greet(Day.SATURDAY); 11 | } 12 | 13 | static void greet(Day day){ 14 | switch (day) { 15 | case MONDAY: 16 | System.out.println("The week begins"); 17 | break; 18 | case SATURDAY: 19 | case SUNDAY: 20 | System.out.println("Hello Weekend!"); 21 | break; 22 | default: 23 | System.out.println("Hello Midweek"); 24 | break; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/src/mycalculator/Main.java: -------------------------------------------------------------------------------- 1 | package mycalculator; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class Main extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("calculator.fxml")); 14 | primaryStage.setTitle("My JavaFX Calculator"); 15 | primaryStage.setScene(new Scene(root, 650, 600)); 16 | primaryStage.show(); 17 | } 18 | 19 | 20 | public static void main(String[] args) { 21 | launch(args); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Chapter8_bad/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 1.8 9 | 10 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Chapter4/src/BonusPoints.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | public class BonusPoints { 5 | 6 | public static void main(String[] args) { 7 | 8 | float totalSpent = getTotalAmount(); 9 | 10 | int bonusPoints; 11 | 12 | if (totalSpent > 100){ 13 | bonusPoints=Math.round(totalSpent*2); 14 | } 15 | else{ 16 | bonusPoints=Math.round(totalSpent); 17 | } 18 | 19 | System.out.println("Today you've earned " + bonusPoints + " points!"); 20 | } 21 | 22 | public static float getTotalAmount(){ 23 | // This is a dummy code just to illustrate the use of 24 | // if statement in the main method 25 | return 125.90f; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Chapter6/src/ArrayListDemo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by NewProgrammer on 3/28/15. 3 | */ 4 | import java.util.ArrayList; 5 | 6 | public class ArrayListDemo { 7 | 8 | public static void main(String[] args) { 9 | // Create and populate an ArrayList 10 | ArrayList friends = new ArrayList(); 11 | friends.add("Mary"); 12 | friends.add("Ann"); 13 | friends.add("David"); 14 | friends.add("Roy"); 15 | 16 | // How many friends are there? 17 | int friendsCount = friends.size(); 18 | 19 | // Print the content of the ArrayList 20 | for (int i=0; i { 12 | return "I'm a dog. My name is " + name; 13 | }; 14 | 15 | Pet myDog = new Pet(dogTalkRules, "Sammy"); 16 | 17 | System.out.println(myDog.speakup()); 18 | 19 | // parrots 20 | Talkative parrotTalkRules = name -> { 21 | return "I'm a parrot. Don't call me " + name; 22 | }; 23 | 24 | Pet myParrot = new Pet(parrotTalkRules, "Charlie"); 25 | 26 | System.out.println(myParrot.speakup()); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Chapter11/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | -------------------------------------------------------------------------------- /Chapter12/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /hello/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter3/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter6/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter7/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter8/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter8_bad/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /HelloPet/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /PingPong/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /TicTacToe/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter5/src/calc/Calculator.java: -------------------------------------------------------------------------------- 1 | package calc; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | public class Calculator { 7 | 8 | static double addTwoNumbers (double first, double second){ 9 | double result = first + second; 10 | System.out.println("" + first + " + " + 11 | second + " = " + result ); 12 | return result; 13 | } 14 | 15 | static double subtractTwoNumbers (double first, double second){ 16 | double result = first - second; 17 | System.out.println("" + first + " - " + 18 | second + " = " + result ); 19 | return result; 20 | } 21 | 22 | public static void main(String[] args) { 23 | 24 | addTwoNumbers(3.55, 50.00); 25 | subtractTwoNumbers(3.55, 50.00); 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /Chapter7/Signin/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter7/sample/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter7/Calculator/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter8_bad/Calculator/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Chapter6/src/pets/FishTank.java: -------------------------------------------------------------------------------- 1 | package pets; 2 | 3 | /** 4 | * Created by NewProgrammer on 3/28/15. 5 | */ 6 | import java.util.ArrayList; 7 | 8 | public class FishTank { 9 | public static void main(String[] args) { 10 | ArrayList fishTank = new ArrayList(); 11 | 12 | Fish fish1 = new Fish(2.5f, "Red"); 13 | Fish fish2 = new Fish(5, "Green"); 14 | 15 | Fish theFish; 16 | 17 | fishTank.add(fish1); 18 | fishTank.add(fish2); 19 | 20 | int fishCount = fishTank.size(); 21 | 22 | for (int i=0;i 100){ 11 | System.out.println("I'm just a little fish and " 12 | + " I can't dive below 100 feet"); 13 | currentDepth=currentDepth - howDeep; 14 | }else{ 15 | System.out.println("Diving for " + howDeep + 16 | " feet"); 17 | System.out.println("I'm at " + currentDepth + 18 | " feet below sea level"); 19 | } 20 | return currentDepth; 21 | } 22 | 23 | public String say(String something){ 24 | return "Hey, don't you know that fish don't talk?"; 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /Chapter5/src/pets/Swimmable.java: -------------------------------------------------------------------------------- 1 | package pets; 2 | 3 | import java.time.LocalDate; 4 | import java.time.Month; 5 | 6 | /** 7 | * Created by NewProgrammer on 3/28/15. 8 | */ 9 | public interface Swimmable { 10 | 11 | public void swim(int howFar); 12 | 13 | public default void dive(int howDeep){ 14 | 15 | if (isSummer()){ 16 | System.out.println("OK, will dive. The water should be warm."); 17 | } else { 18 | System.out.println("Can't dive, sorry. The water's cold for diving."); 19 | } 20 | }; 21 | 22 | // Check if it's summer now 23 | static boolean isSummer(){ 24 | Month month = LocalDate.now().getMonth(); 25 | if (month == Month.JUNE || month == Month.JULY || month == Month.AUGUST){ 26 | return true; 27 | } else{ 28 | return false; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Chapter4/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Chapter5/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Chapter5/src/solutions/pets/Swimmable.java: -------------------------------------------------------------------------------- 1 | package solutions.pets; 2 | 3 | import java.time.LocalDate; 4 | import java.time.Month; 5 | 6 | /** 7 | * Created by NewProgrammer on 3/28/15. 8 | */ 9 | public interface Swimmable { 10 | 11 | public void swim(int howFar); 12 | 13 | public default void dive(int howDeep){ 14 | 15 | if (isSummer()){ 16 | System.out.println("OK, will dive. The water should be warm."); 17 | } else { 18 | System.out.println("Can't dive, sorry. The water's cold for diving."); 19 | } 20 | }; 21 | 22 | // Check if it's summer now 23 | static boolean isSummer(){ 24 | Month month = LocalDate.now().getMonth(); 25 | if (month == Month.JUNE || month == Month.JULY || month == Month.AUGUST){ 26 | return true; 27 | } else{ 28 | return false; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Chapter8/src/signin/Controller.java: -------------------------------------------------------------------------------- 1 | package signin; 2 | 3 | import javafx.event.ActionEvent; 4 | import javafx.fxml.FXML; 5 | import javafx.scene.control.PasswordField; 6 | import javafx.scene.control.TextField; 7 | 8 | public class Controller { 9 | 10 | @FXML 11 | private TextField id; 12 | 13 | @FXML 14 | private PasswordField pwd; 15 | 16 | public void signInClicked(ActionEvent evt){ 17 | 18 | String userID = id.getText(); 19 | String password = pwd.getText(); 20 | 21 | if (!"Yakov".equals(userID)){ 22 | id.setStyle("-fx-background-color: lightpink;"); 23 | } else{ 24 | id.setStyle("-fx-background-color: white;"); 25 | } 26 | 27 | System.out.println("got id:" + userID + ", got password: " + password); 28 | 29 | System.out.println("Hello from signInClicked method in controller"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /TicTacToe/src/mygame/TicTacToe.java: -------------------------------------------------------------------------------- 1 | package mygame; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class TicTacToe extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("tictactoe.fxml")); 14 | primaryStage.setTitle("TicTacToe"); 15 | Scene scene = new Scene(root, 300, 325); 16 | scene.getStylesheets().add(getClass() 17 | .getResource("tictactoe.css").toExternalForm()); 18 | primaryStage.setResizable(false); 19 | primaryStage.setScene(scene); 20 | primaryStage.show(); 21 | } 22 | 23 | 24 | public static void main(String[] args) { 25 | launch(args); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Chapter8/src/signin/MainWithBinding.java: -------------------------------------------------------------------------------- 1 | package signin; 2 | 3 | import javafx.application.Application; 4 | import javafx.fxml.FXMLLoader; 5 | import javafx.scene.Parent; 6 | import javafx.scene.Scene; 7 | import javafx.stage.Stage; 8 | 9 | public class MainWithBinding extends Application { 10 | 11 | @Override 12 | public void start(Stage primaryStage) throws Exception{ 13 | Parent root = FXMLLoader.load(getClass().getResource("signin_for_binding_sample.fxml")); 14 | 15 | primaryStage.setTitle("Sign In"); 16 | 17 | Scene scene = new Scene(root, 200, 170); 18 | scene.getStylesheets().add(getClass() 19 | .getResource("signin.css").toExternalForm()); 20 | 21 | 22 | 23 | primaryStage.setScene(scene); 24 | primaryStage.show(); 25 | } 26 | 27 | 28 | public static void main(String[] args) { 29 | launch(args); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Chapter8_bad/Signin/src/signin/Controller.java: -------------------------------------------------------------------------------- 1 | package signin; 2 | 3 | import javafx.event.ActionEvent; 4 | import javafx.fxml.FXML; 5 | import javafx.scene.control.PasswordField; 6 | import javafx.scene.control.TextField; 7 | 8 | public class Controller { 9 | 10 | @FXML 11 | private TextField id; 12 | 13 | @FXML 14 | private PasswordField pwd; 15 | 16 | public void signInClicked(ActionEvent evt){ 17 | 18 | String userID = id.getText(); 19 | String password = pwd.getText(); 20 | 21 | if (!"Yakov".equals(userID)){ 22 | id.setStyle("-fx-background-color: lightpink;"); 23 | } else{ 24 | id.setStyle("-fx-background-color: white;"); 25 | } 26 | 27 | System.out.println("got id:" + userID + ", got password: " + password); 28 | 29 | System.out.println("Hello from signInClicked method in controller"); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Chapter7/sample/src/sample/sample.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |