Java Object/ Class/ Object generating

📍Object

What is an object:

A Java object is a member of a Java class(Object is created from a class). Each object has properties and behaviors. The properties of an object is stored in variables, while methods display the object's  behavior.

🔰For example in real life, Car is Object. The car has properties(variable) such as weight and color, and behavior(method), such as drive and brake. 

🌟a class is the definition or template,and an object is an instance of that definition. 


📍Create an object

🌟 You can create multiple objects of one class. 

  1. In order to create an object, a class should be based(Because the coding implement of the object concept is the class), and the class to be based is called a "Class reference".
  2. The object must have a name(Need to give variable name).
  3. new keyword is definitely use to generate an object(new keyword-object generate - JDK pre-build).
  4. The constructor of the class reference is required.
  5. Class reference(left side) "assign" (=), Constructor(right side) "equal" (==).
🌟Java is case-sensitive language. So exactly the naming convention should have simple /capital. Keywords cannot be used for naming conventions...

#Study #Knowledge #Coding #Programming #SoftwareDevelopment #SkillBuilding


Comments