search

Home  >  Q&A  >  body text

Java,对象的生命周期。

怪我咯怪我咯2769 days ago402

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-04-17 16:55:06

    All objects have one

    protected void finalize();

    Method. Is inherited from Object. This method is called before the object is recycled. You can rewrite this method and print the current time in it.

    As for the creation time, just print it in the construction method.

    reply
    0
  • Cancelreply