Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Java, extends and implements Usage     - C / C ++ language usage summary of const (Programming)

- 8 Git tips (Linux)

- Oracle table of nested loop connection (Database)

- pdf.js Tutorial (Linux)

- After restarting network services, DNS address failure (Linux)

- IPTABLES configuration steps under Linux (Linux)

- Linux how to handle file names that contain spaces and special characters (Linux)

- Ceph distributed storage system is installed on a CentOS 7.1 (Server)

- JavaScript original values and complex values (Programming)

- Elasticsearch 2.20 Beginners: aggregation (Server)

- OpenGL Superb Learning Notes - Vertex Shader example (Programming)

- Linux Shell debugging (Programming)

- Browser caching mechanism on the analysis (Linux)

- Ubuntu file security removal tool (Linux)

- RHEL7 system making use of OpenStack mirror (Linux)

- Linux deploy Tutorial (Linux)

- Loop arrays in C language is not easy to find a bug (Programming)

- C language - Traverse pci device (Programming)

- Linux System Getting Started Learning: Fix ImportError: No module named scapy.all (Linux)

- MySQL and Oracle time zone settings compare (Database)

  Java, extends and implements Usage
  Add Date : 2017-08-31      
  Java, extends and implements Usage

1. In the class declaration to create a subclass of the class keyword extends. A class declaration by keyword implements its own use one or more interfaces.

extends inherit a class, then you can use inherit the parent class method, you can also override the parent class method; implements is to implement multiple interfaces, the interface methods are generally empty, it must be rewritten to use.

2.extends is inherited from the parent class, as long as that class is not declared as final or as abstract class definition that will be able to inherit, JAVA does not support multiple inheritance, but you can use the interface to achieve, so we must use implements, inherited only inherit a class, but implements can implement multiple interfaces, separated by a comma on the line

3. extends, the parent class can be called the father of initialization this.parent (). And will override the parent class defined variables or functions. Such benefits are: architect defined interface that allows engineers to achieve it. The entire project development efficiency and reduce development costs significantly. And implements, to achieve the parent class, subclass can not override the method or variable of the parent class. Even if the parent class subclass definition and the same variable or function, the parent class will be substituted out.

Summary: Both implementations specific use, is to look at the actual situation of the project, the need to achieve, can not be modified implements, need only define the interface implementation, may be modified or extended good use extends.
- To setup NOTRACK and TRACK of conntrack in iptables (Linux)
- Share useful bash aliases and functions (Linux)
- Linux, modify / etc / profile file (Linux)
- Debian 7.6 install Nvidia graphics driver (Linux)
- Vi editor Introduction (Linux)
- Deep understanding of C # generics (Programming)
- To learn linux security (Linux)
- CentOS iptables firewall enabled (Linux)
- After Ubuntu Password Forgot your way back (Linux)
- Ubuntu 14.04 solved using MyEclipse 10.7 flash back (Linux)
- How to monitor Linux system performance Nmon (Linux)
- PostgreSQL Stream Configuration (Database)
- Linux system package manager (rpm, yum, source packages installation) (Linux)
- Scala REPL Shell call (Programming)
- To deploy MySQL database with separate read and write OneProxy (Database)
- Linux System Getting Started Learning: The Linux ac command (Linux)
- Linux batch copy data script (Linux)
- Linux find and xargs (Linux)
- Let CentOS perform PPPoE dial-up, ADSL can be used in a network environment! (Linux)
- How to set up HTTPS policies for older browsers (Server)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.