"Java Development" object-oriented preliminary understanding and basic concept explanation

Source: Internet
Author: User

Simply put the Java basics in front of you, then start the object-oriented journey.objects (object):In short, the world is made up of objects, all things visible.classes (Class):To put it bluntly is to have the same characteristics or attributes as a class of objects with: Static properties: Properties, variables and other dynamic characteristics: methods, namely the function of simple example: a person as an object, has the attributes of height, gender, age, etc., with methods such as eating, learning and so on, and humans can be regarded as the object of the class The class in Java is the keyword for the classes. The above description can be abbreviated with Java code: public class person {String name;int age ; void Eat ()     {     } Void Study ()     {    }}  
After the class is created, to take advantage of the created class, that is, to create an object instantiation, similar to the previous basic data type declaration like Person p=new ();p Erson as the class name, p is the new object, so P has the properties and methods in the People class.        public class test{public static void Main (string[] args) {person p=new person ();    P.eat (); This shows that when the object is instantiated, p acts as an object in the person class and can invoke the property or method of the person class. Personal Summary: In class, the properties and methods are written, and then in the main function, the object instantiation, you can make the relevant property method calls. It is important to object-oriented thinking, in the late learning, programming in the actual life of some examples, rather than to write programs and write code, to follow certain logic.

From for notes (Wiz)

"Java Development" object-oriented preliminary understanding and basic concept explanation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.