Home  >  Article  >  Java  >  What does instance mean in java?

What does instance mean in java?

尚
Original
2019-12-04 16:31:476495browse

What does instance mean in java?

Instance refers to the object implementation based on a certain class. This process is called instantiation.

Instance generation:

1. Use the new keyword (a construction method that requires public modification. The default no-parameter construction will be overwritten and hidden. You need to pay attention when using the framework. You can also pass Control the access modifier of the constructor and implement the singleton mode - lazy man | hungry man (double check lock) | static inner class | enumeration -.)

2. The newInstance method of the Class class.

3. The newInstance method of the Constructor class

4. Clone (implementing the Cloneable interface)

Serialization and deserialization (implementing Serializable or Externalizable)

For more java knowledge, please pay attention to the java basic tutorial column.

The above is the detailed content of What does instance mean in java?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn