Содержание
- 2. Abstract Classes An abstract class is a class that is declared abstract Abstract classes cannot be
- 3. Abstract Methods An abstract method is a method that is declared without an implementation: abstract void
- 4. An Abstract Classes II A subclass of an abstract class usually provides implementations for all of
- 5. Example: Abstract DepoBase Class Modify 442InterestSum project using DepoBase as an abstract class. * Infopulse Training
- 6. Example: Abstract DepoBase Class See 451AbstractDepo project for the full text * Infopulse Training Center
- 7. How to Create and Use Library To create depo library: Right click on the app package
- 8. Interfaces An interface is a reference type, similar to a class, that can contain only constants,
- 9. Defining an Interface An interface declaration consists of: modifiers the keyword interface the interface name a
- 10. Interface Definition Example public interface GroupedInterface extends Interface1, Interface2, Interface3 { // constant declarations double E
- 11. The Interface Body The interface body contains method declarations for all the methods included in the
- 12. Use an Interface To use an interface, you write a class that implements the interface When
- 13. Interfaces and Multiple Inheritance In Java, a class can inherit from only one class but it
- 14. Using an Interface as a Type You can use interface names anywhere you can use any
- 15. Exercise: InterestInterface Modify 442InterestSum project using interface * Infopulse Training Center
- 16. Exercise: InterestInterface See 452InterfaceDepo project for the full text * Infopulse Training Center
- 17. Cloning (1 of 2) Use clone() method to get independent object instead of object’s assignment clone()
- 18. Cloning (2 of 2) The clone method is a protected method of Object, which means that
- 19. Deep Cloning To make a deep copy, you have clone the mutable instance fields in the
- 20. Example: DepoBase Cloning public abstract class DepoBase implements Cloneable{ . . . . . . public
- 21. Interfaces in Java SE 8 The interface body can contain: abstract methods (followed by a semicolon,
- 22. Interface Default Methods You specify that a method definition in an interface is a default method
- 23. Exercise: Default Method Modify 452InterfaceDepo project: Remove abstract DepoBase class Add calculateInterest method as default method
- 24. Exercise: Default Method See 453DefaultMethod project for the full text
- 25. Functional Interfaces A functional interface is any interface that contains only one abstract method A functional
- 26. Lambda Expression A lambda expression looks a lot like a method declaration You can consider lambda
- 27. Example of Lambda Expression I public class Calculator { interface IntegerMath { int operation(int a, int
- 28. Example of Lambda Expression II public static void main(String... args) { Calculator myApp = new Calculator();
- 29. Example of Lambda Expression See 454LambdaCalulator for the full text
- 30. Lambda Expression Syntax I A lambda expression consists of the following: a comma-separated list of formal
- 31. Lambda Expression Syntax II You can omit the data type of the parameters in a lambda
- 33. Скачать презентацию