original text :http://blog.csdn.net/fhm727/article/details/5222965

1、abstract And static

(what)

abstract: Used to declare abstract methods , Abstract methods have no method bodies , Cannot be called directly , Must be in subclass overriding Only after that can we use

static: Used to declare static methods , Static methods can be called by classes and their objects

(how)

static And abstract Can't be used at the same time

(why)

use static Declaring a method means that the method can be called directly by a class without generating an instance of the class , and abstract Method cannot be called , The two contradict .

2、abstract And native

(what)

native: Used to declare local methods , The implementation of this method consists of java Language implementation , such as C. Commonly used in java Interaction with external environment , Or interact with the operating system

(how)

native With all the others java Identifiers are used together , however abstract With the exception of .     

(why)

because native Implying that these methods have implementers , It's just that these implementers

Right and wrong java Of , however abstract But it clearly indicates that these methods have no implementers .

3、abstract And synchronized

(what)

synchronized: This method is used to prevent multiple threads from calling an object at the same time , And static Concatenation prevents multiple threads from calling this method of a class at the same time

(how)

abstract And synchronized Can't be used at the same time

(why)

from synchronized It can also be seen that , use synchronized The premise is that the method can be called directly , Obviously and abstract Continuous use

Reprint :abstract Is it possible to use the same method as static, Whether it can be at the same time native, Whether it can be at the same time synchronized? More articles about

  1. abstract Is it possible to use the same method as static, Whether it can be at the same time native, Whether it can be at the same time synchronized?

    1.abstract And static (what) abstract: Used to declare abstract methods , Abstract methods have no method bodies , Cannot be called directly , Must be in subclass overriding Only after that can we use static: Used to declare static methods , static state ...

  2. abstract Is it possible to use the same method as static Whether it can be at the same time native Is it possible to

    Move what I wrote before 1.abstract And static (what)​ abstract: Used to declare abstract methods , Abstract methods have no method bodies , Cannot be called directly , Must be in subclass overriding Only after that can we use static: be used for ...

  3. 【Java Interview questions 】10 abstract Of method Whether it can be at the same time static, Whether it can be at the same time native, Whether it can be at the same time synchronized?

    1.abstract It is abstract. , A method is declared but not implemented , His implementation is to be implemented in a subclass that declares the class . 2.static Is static , A method or property that belongs to a class but not to an object 3.synchronized It's synchronization ...

  4. abstract Of method Whether it can be at the same time static, Whether it can be at the same time native, Whether it can be at the same time synchronized?

    abstract Of method Can not be static Of , Because abstract methods are implemented by subclasses , and static Not related to subclasses ! native Method means that the method is implemented in another platform dependent programming language , There is no quilt class ...

  5. abstract Summary of modification methods

    abstract This method modifies , Mainly used in abstract classes and abstract methods . Abstract classes are not instantiatable, such as public abstract class Test{ } It can contain abstract methods public abstract ...

  6. abstract Modification method

    abstract This method modifies , Mainly used in abstract classes and abstract methods . Abstract classes are not instantiatable, such as public abstract class Test{ } It can contain abstract methods public abstract ...

  7. 【 Reprint 】StringUtils Methods to introduce

    org.apache.commons.lang.StringUtils The operation object of the method in is java.lang.String Object of type , yes JDK Provide Of String Type operation method supplement , And is null Safe ...

  8. [ Reprint ] Summary of machine learning optimization methods :SGD,Momentum,AdaGrad,RMSProp,Adam

    [ Reprint ] Summary of machine learning optimization methods :SGD,Momentum,AdaGrad,RMSProp,Adam https://blog.csdn.net/u010089444/article/details/76 ...

  9. Can we start from a static Right and wrong in the method static Method call ?

    Can not be . Because not static Methods are associated with objects , After an object has to be created , To make a method call on this object , and static Method calls do not need to create objects , Can be called directly . in other words , When one static Method is called , ...

Random recommendation

  1. iOS Interview questions collection

    1.#import and #include The difference between ,@class What is the ? 2. What's the difference between shallow copy and deep copy ? 3.Objective-C The difference between categories and class extensions in ? 4.Objective-C The difference between heap and stack ? 5. Memory ...

  2. cocos2d-x Start configuration (Windows platform )

    A good workman does his work well , You must sharpen your tools first . To use cocos2d-x engine , We need to configure ( Or install ) engine , To  cocos2d-x Official website download page download engine , The official website gives 2.x and 3.x Two versions , I'm using 3.6 Version of ,3.x Version class for ...

  3. ( 5、 ... and ) Learn together Unix Environment advanced programming (APUE) And Process environment

    . . . . . Catalog ( One ) Learn together Unix Environment advanced programming (APUE) And standard IO ( Two ) Learn together Unix Environment advanced programming (APUE) And file IO ( 3、 ... and ) Learn together Unix Senior editor of environment ...

  4. angularjs Instructions (directive) Detailed explanation (2)

    Original address Last time we talked about transclude, that , Now let's go on to the following . 9.scope Optional parameters , The default value is false. Value : false - In this directive No new ones will be created scop ...

  5. 11 month 09 Japan 《 Orville Power-BI vs Microsoft Power BI》 Tencent class has started

    Students who have attended Orwell open class may have a question : Orville Power-BI And Microsoft Power BI Is it the same , Why the same name ? As there are many in the world John.Jack.Marry… equally , Orville Power-BI And Microsoft Po ...

  6. How to setTimeout() Method dissemination

    As follows JavaScript Code : function printApple(apple){ console.log(apple, "is a kind of healthy fruit&qu ...

  7. asp.net Call in COM Component release IIS Often see mistakes 80070005 Solution

    A lot of people .net Development Web The site cites COM Components , Everything is OK when debugging , But once it's released to IIS The following error will be prompted : retrieval COM Class factory CLSID by {} Failed when creating a component of , The reason is the following error : 80070005 ...

  8. android ndk By traversing and deleting files

            In the process of mobile development , It's hard to avoid some local file management operations . for example , Very common app With Weibo . Wechat should clear the cache function , This function is to go app Folder . Then delete all cache files . Use java Of File Class to achieve local file traversal and delete ...

  9. Docker Learning notes -Docker for Linux install

    Preface : Environmental Science :centos7.5 64 position Text : Docker The package is already included in the default CentOS-Extras Software source . So you want to install docker, Just run the following yum command : yum i ...

  10. Luogu P1078 Cultural journey Problem solving report

    P1078 Cultural journey Title Description There is a messenger who is going to travel all over the world , Every time he goes to a country , Can learn a culture , But he doesn't want to learn any culture more than once ( That is, if he learns a certain culture , Then he can't go to other countries with this culture ). Different countries may ...