Learn Java for Web Development
CHAPTER 8: Play with Java and Scala 379 Listing 8-14. Implementation of the newBook( ) Action public static Result newBook() { ...
380 CHAPTER 8: Play with Java and Scala This will create an Ebean server connected to the default data source, managing all enti ...
CHAPTER 8: Play with Java and Scala 381 Now when you test the URL http://localhost:9000/, you will see the page shown in Figure ...
382 CHAPTER 8: Play with Java and Scala Deleting Books Now that you can create books, you need to be able to delete them. For th ...
383 Appendix A Introduction to Java One of the fundamental ways in which complexity can be handled is abstraction, which is appl ...
384 APPENDIX A: Introduction to Java Listing A-2. Creating the Object ClassA var1 = new ClassA(); The process of creating object ...
APPENDIX A: Introduction to Java 385 instance methods. Instance variables and instance methods, which belong to objects, are cal ...
386 APPENDIX A: Introduction to Java Method Overloading Each method has a name and a formal parameter list. The name of the meth ...
APPENDIX A: Introduction to Java 387 Constructors When an object is created using a new operator, the constructors are called to ...
388 APPENDIX A: Introduction to Java The explicit default constructor ensures that any object created with the object creation e ...
APPENDIX A: Introduction to Java 389 Encapsulation Encapsulation is the technique to achieve data hiding by preventing the data ...
390 APPENDIX A: Introduction to Java Listing A-15 illustrates how Figure A-1 could be implemented in code. It illustrates implem ...
APPENDIX A: Introduction to Java 391 package apress.appendix_A; public class ClassB extends ClassA { } Listing A-16 ...
392 APPENDIX A: Introduction to Java Listing A-17. Constructor Chaining package apress.appendix_A; public class ClassA { public ...
APPENDIX A: Introduction to Java 393 The output proves that the constructor of the subclass invokes the base class’s no-arg cons ...
394 APPENDIX A: Introduction to Java Figure A-2 shows a superclass-subclass relationship. This relationship allows you to assign ...
APPENDIX A: Introduction to Java 395 Now the code of ClassB looks like that shown in Listing A-20. Listing A-20. Overriding meth ...
396 APPENDIX A: Introduction to Java This is, at compile time, the call methodA( ) on var1 will be checked against a reference t ...
APPENDIX A: Introduction to Java 397 Figure A-4 shows InterfaceA, just to illustrate that the reference type could be an interfa ...
398 APPENDIX A: Introduction to Java The actual object type in line 4 of Listing A-22 is ClassB, so at runtime the JVM checks wh ...
«
15
16
17
18
19
20
21
22
23
24
»
Free download pdf