Abstract method cannot use Final, Static modified non-Abstract method in the Abstract class can be used in Fina

xiaoxiao2021-04-08  430

Abstract methods in the abstract class cannot be Final, but the non-abstract method is before adding Final to compile by Abstract and Final mutually exclusive, the former is dedicated to inheritance, the latter prohibits inheritance

Abstract method in abstract classes cannot be static

Non-abstract methods can be static

Wrapped Integer, String, Float, Double, etc. are all Final classes, can't be inherited! Integer i = new integer ("6"); if the string is not a number, it will generate an exception (no compilation errors) but for Boolean, this rule does not apply. When the string (case is not related to case), the value represented by the Boolean object is true, and the other strings are false such as:

Boolean B = New Boolean ("Afiwou"); Representative False

Boolean B = New Boolean ("True"); is TRUE

转载请注明原文地址:https://www.9cbs.com/read-132841.html

New Post(0)