Defining abstract classes , You have to define abstract methods , Abstract methods have no method bodies {}, Just prove that the abstract method It doesn't work , Abstract method Is to subclass inheritance overlay run ,

A subclass inherits -> abstract class You have to override the abstract method , Otherwise, the compilation fails ;


Fruit case :

Define abstract classes FruitAbstract:

package android.java.oop16;
/**
* Define an abstract class , Such kind There can be abstract methods , There can also be common methods , Static methods wait ;
*/
public abstract class FruitAbstract { /**
* To buy fruit , What kind of fruit , I don't know yet , It's abstract , Vague ,
* So it's defined as an abstract method , What kind of fruit is it , Let subclasses override the implementation
*/
public abstract void info(); }

describe

Android-Java- More articles on abstract classes

  1. [Android] Java Basic : preview

    Basic teaching :lecture, video, lecturer: Matt Stoker Java teaching :http://www.runoob.com/java/java-intro.html[ Novice tutorial , very ...

  2. android java Detailed explanation of design mode Demo

    android java Detailed explanation of design mode Recently I read an article about design patterns , Deep experience , On this basis, I will write the case of each design pattern as Demo In the form of , It is convenient for readers to study , First of all, let's share the article with you : Design patterns (Design ...

  3. java abstract class

    Java abstract class In the concept of object-oriented , All objects are represented by classes , But the other way around , Not all classes are used to describe objects , If a class does not contain enough information to describe a specific object , Such a class is an abstract class . Abstract class except not ...

  4. .NET/android/java/iOS AES Universal encryption and decryption ( Fixed Android )

    Mobile terminals are becoming more and more popular , We are in the process of development , There will always be scenes where we have to deal with mobile terminals , such as .NET and android perhaps iOS To deal with . To make data interaction more secure , We need to encrypt the data . I studied it today , Encryption in several languages ...

  5. Android java Pass on int Type array gives C

    Next to the previous article <Android java Pass on int Type data to C><Android java Pass on string Type data to C>, Continue to practice Realization public native int[] ...

  6. Android java Pass on string Type data to C

    This paper then implements <Android java Pass on int Type data to C> Methods that have not yet been implemented : public native String sayHelloInC(String s); First, paste a tool method , ...

  7. .NET/android/java/iOS AES Universal encryption and decryption

    Mobile terminals are becoming more and more popular , We are in the process of development , There will always be scenes where we have to deal with mobile terminals , such as .NET and android perhaps iOS To deal with . To make data interaction more secure , We need to encrypt the data . I studied it today , Encryption in several languages ...

  8. android Java BASE64 Encoding and decoding two : Picture encoding and decoding

    1. preparation (1) Integration in the project Base64 Code , For the integration method, see the first blog post :android Java BASE64 Encoding and decoding one : Basics (2) add to ImgHelper  Tool class package com.a ...

  9. Java Interface 、Java abstract class 、C++ The difference between abstract classes

    Because these three data types are designed to create the top-level architecture of the class hierarchy , There are some similarities in usage , Here's a simple distinction : Interface : For interface interface Keyword definition , The name is usually used -able Adjectives of form . Interfaces usually define abstract methods and ...

  10. java The difference and usage between abstract class and interface

    java The difference and usage between abstract class and interface One . Methods in abstract classes can be implemented , But the method in the interface can only declare . Two . Interface is the result of design : Abstract classes are the result of refactoring . 3、 ... and .java Multiple inheritance is not supported , So inheriting abstract classes can only inherit one ...

Random recommendation

  1. [osx] Check that the port is occupied

    netstat command netstat -an | grep 3306 3306 Replace with need grep Port number lsof command sudo lsof -i :80 -i The parameter represents the network link ,:80 Indicate the port number , The order will ...

  2. WEBAPP Development skills ( Mobile website development considerations )

    The following is just my personal summary , If you have better advice , Please leave a message , Let's make progress together !!- -! 1. Responsive development web, That is, the page must be adaptive to the screen size , You can use a fluid layout , As in the previous article ( Adaptive width layout ), Other specific small problems can ...

  3. node.js Next when.js(Promises/A) Practice

    Suppose a business scenario : adopt rss Address , obtain rss And save it in a file ,rss The address is saved in a file . The business to complete the scenario needs to be completed 3 A mission : 1. Read from file rss Address . 2. obtain rss. 3. Save in file . Finally, the three ...

  4. log4j.properties Configuration details ( turn )

    This article is transferred from http://it.oyksoft.com/log4j/ Thank you very much for your hard work and sharing . One .Log4j brief introduction Log4j There are three main components :Loggers( Recorder ),Appenders ...

  5. Red Hat Enterprise Linux 7 New functions

     Introduction to the latest version of red hat's flagship platform delivers significantly enhanced usability . Performance and reliability . The rich new functions are architecture . System administrators and developers provide the resources they need to innovate and manage more efficiently . Architects : Red hat Enterprises Linux 7 fit ...

  6. Take notes --Linux Programming

    linux c Programming open() read() write() The use of functions and examples | Dairy blog - Google Chrome (2013/8/31 17:56:10) Today, I'm going to put the papers IO Some things to do with the operation ...

  7. WPF Developed lottery program ( A good example of hand training ) Source code attached

    Preface WPF yes .NET The latest interface development library , The development interface is very flexible ! But learning WPF It's also very difficult . At the invitation of a friend , Write a small program . The program is small , Five zang organs ,WPF A glimpse of the flexibility of development . It's a good reference for beginners , ...

  8. be based on STM32 Single chip optical fingerprint identification module (FPM10A) Full course ( be based on C Language )

    This article is reprinted. , Its source is in the reference :1, With a little modification , Because of the recent use of this module , So it's sorted out ! 1. platform First of all, I used struggle STM32 Development board MINI plate be based on STM32 Single chip optical fingerprint identification module (FPM10A) Quanjiao ...

  9. C# MemoryCache GCHandle

    MemoryCache Used for a long time in the project , It feels simple , I've seen the source code before , Main borrowing MemoryCacheStore To complete the data storage , It's thread safe ,MemoryCacheStore To borrow Hasht ...

  10. Linux Commonly used instructions -ssh

    Catalog ssh Remote login ssh Password free login Generate public and private keys Copy the public key to other slaves The document states id_rsa id_rsa.pub authorized_keys known_host SSH( Remote connection tools ) ...