Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Java abstract class instantiation     - Python image processing library (PIL) to install and simple to use (Linux)

- How ONLYOFFICE collaborative editing document on Linux (Linux)

- KVM QEMU virtual machine installation configuration under CentOS (Linux)

- Integrated security administrator Linux accident management (Linux)

- Linux using DenyHosts prevents ssh cracks (Linux)

- 25 Git Usage Tips (Linux)

- BusyBox making the file system (Linux)

- Storm basic framework for analysis (Programming)

- Towards Docker (Server)

- Ubuntu 14.04.02 LTS startup items erroneous writing / dev / sda1 (win 7 loader) Repair (Linux)

- It is time to upgrade your gulp 4.0 (Programming)

- Easily create RPM packages using the FPM (Linux)

- Vagrant build LNMP environment (Server)

- Jigsaw project will solve the problem of Java JAR hell Mody (Programming)

- How to install Docker and basic usage on Ubuntu 15.04 (Server)

- JavaScript event handling Detailed (Programming)

- MySQL In can not be overridden with an internal connection (Database)

- Linux Creating a new user error Creating mailbox file: File exists (Linux)

- Linux MultiPath software implementation instructions (Linux)

- Make command tutorial (Linux)

 
         
  Java abstract class instantiation
     
  Add Date : 2018-11-21      
         
         
         
  Needless to say, is not an instance of an abstract class, abstract class not specifically described as a specific type of thing, it is the common feature extraction similarity specific things abstract, realize it does not make any sense.

If you do not inherit the abstract class, but "instance" of abstract class, written as follows:

package subClass;
abstract class ParentClass {
    public abstract void abstractFun ();
}

class SubClass {
    // Here "instantiated" ParentClass is instantiated ParentClass () {}, and abstract methods ParentClass implementation, therefore an abstract class is not instantiated
    ParentClass parentClass = new ParentClass () {
        @Override
        public void abstractFun () {
            System.out.println ( "abstractFun ()");
        }
    };
    
}

public class TestExtends {
    public static void main (String args []) {
        SubClass sub = new SubClass ();
        sub.parentClass.abstractFun ();
    }
}

Examples of "ParentClass is new ParentClass () {}, and to achieve ParentClass abstract method, rather than newParentClass ().

The above structure and Android similar event listeners:

  findViewById (R.id.stop_Button) .setOnClickListener (new View.OnClickListener () {
When @Override omitted @Override do not think that is an internal class.
 public void onClick (View v) {
         stopService (it);
      }
  });
     
         
         
         
  More:      
 
- Use OpenSSL carried BASE64 encoding and decoding (Linux)
- To install PXE + Kickstart under CentOS 6.x operating system (Linux)
- How to build a custom exclusive Ubuntu Live CD (Linux)
- Ubuntu prompt / lack of boot space solutions (Linux)
- Linux Security Raiders SSH tools SCP uses examples to explain in detail (Linux)
- iOS persistence of data archiving NSKeyedArchiver (Programming)
- JDK tools jstat (Linux)
- CentOS / Linux kernel upgrade (Linux)
- PostgreSQL procedural language learning (Database)
- Under Ubuntu 15.04 installation JDK8 (Linux)
- Hadoop 1 and 2.x installation notes (Server)
- Oracle Data File Management (Database)
- Linux partition command (Linux)
- ORA-00845: MEMORY_TARGET not supported on this system Problem (Database)
- Linux file and directory management - ls, cp, mv (Linux)
- Installation and Configuration ISC DHCP server on Debian Linux (Server)
- Python Basics Tutorial - lambda keyword (Programming)
- 30 Practical Linux system administrators will learn the command (Linux)
- Linux tar compressed exclude a folder (Linux)
- CentOS 6.6 install Oracle 11gR2 database (Database)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.