We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
virtual
abstract
virtual method,
abstract method
virtual method
abstract class
java8 严格区分了 localDate, localTime, LocalDatetime 不提供日期部分,不允许解析,直接异常 LocaTime 不允许 格式化为 yyyy, 也是直接异常 相对来说,更喜欢 joda一些,兼容性更好
The text was updated successfully, but these errors were encountered:
多态是OO里非常重要的特性, 抽象、封装、继承 某种程度上就是为了实现多态
override 这个重要的的功能, java并没有用关键字来实现, 而是用了个 @java.lang.Override(jdk1.5才引入) 注解来实现了,并且在javac编译器中,并没有强制要求强制标记 @override , 导致有复杂继承关系的代码, override 逻辑非常不清晰,需要借助外部工具来梳理。eg: juc 中的类基本都没有添加 @override 注解。(这个应该是历史包袱,没法轻易改动)
@java.lang.Override
@override
比如下方, java.util.AbstractList 并对于 java.util.Collection<E> 方法的override , 中间经过了 List<E> , AbstractCollection, 多层的 override 导致 override 逻辑树不清晰。
java.util.AbstractList
java.util.Collection<E>
List<E>
AbstractCollection
如果不熟悉整个设计和继承结构, 只看代码, 不借助IDEA工具, 很难分清到底是实现类自己的方法, 还是override 父类的方法。
Sorry, something went wrong.
j.u.c.CompletableFuture
j.u.c 里的代码,
No branches or pull requests
c#
virtual
,abstract
修饰 method, 必须为 public,否则编译错误virtual method,
必须有方法体abstract method
, 不能有方法体virtual method
, 子类可以添加 override 重写abstract method
, 子类必须添加 override 重写abstract class
不能实例化, 需要子类来实现java
virtual
关键字abstract
关键字规则同 c#, 除了子类重写方法可以不标记 override时间格式化时, 默认日期, 1970 vs 2021
The text was updated successfully, but these errors were encountered: