• Think in Java


    Java also has a “default” access, which comes into play if you don’t use one of the aforementioned specifiers. This is usually called package access because classes can access the members of other classes in the same package (library component), but outside of the package those same members appear to be private.

    The “wrapper” classes for the primitive data types allow you to make a non-primitive object on the heap to represent that primitive type.

    java.lang is implicitly included in every Java code file

    constructor 内部可能通过this 调用其它construcotr,但在成员函数内不能用this调用constructor

    finalize()在什么时候被调用?有三种情况
    1.所有对象被Garbage Collection时自动调用,比如运行System.gc()的时候.
    2.程序退出时为每个对象调用一次finalize方法。
    3.显式的调用finalize方法
    除此以外,正常情况下,当某个对象被系统收集为无用信息的时候,finalize()将被自动调用,但是jvm不保证finalize()一定被调用,也就是说,finalize()的调用是不确定的,这也就是为什么sun不提倡使用finalize()的原因

    because they are in the same directory and have no explicit package name. Java treats files like this as implicitly part of the “default package” for that directory, and thus they provide package access to all the other files in that directory.

    protected also gives package access—that is, other classes in the same package may access protected elements

    The actual process of initialization is:
    1.The storage allocated for the object is initialized to binary zero before anything else happens.
    2.The base-class constructors are called as described previously. At this point, the overridden draw( ) method is called (yes, before the RoundGlyph constructor is called), which discovers a radius value of zero, due to Step 1.
    3.Member initializers are called in the order of declaration.
    4.The body of the derived-class constructor is called.

    @Override

    When you mean to override a method, you can choose to add this annotation and the compiler will produce an error message if you accidentally overload instead of overriding

  • 相关阅读:
    [No0000C9]神秘的掐指一算是什么?教教你也会
    [No0000C8]英特尔快速存储IRST要不要装
    [No0000C7]windows 10桌面切换快捷键,win10
    [No0000C6]Visual Studio 2017 函数头显示引用个数
    [No0000C4]TortoiseSVN配置外部对比工具
    [No0000C5]VS2010删除空行
    [No0000C3]StarUML2 全平台破解方法
    [No0000C2]WPF 数据绑定的调试
    [No0000C1]Excel 删除空白行和空白列VBA代码
    [No0000C0]百度网盘真实地址解析(不用下载百度网盘)20170301
  • 原文地址:https://www.cnblogs.com/lgxqf/p/1590964.html
Copyright © 2020-2023  润新知