The Java language's object-oriented concepts and basic knowledge of classes and objects

Source: Internet
Author: User

1. What is Object-oriented

(1) Object-oriented is a programming method

(2) Object-oriented is a way of thinking

(3) Object-oriented is not a programming language

2. Object-oriented benefits

3. How to learn to face the image

(1) Mastering an object-oriented language grammar

(2) Mastering object-oriented thinking mode

(3) familiar with object-oriented design principles

(4) Mastering object-oriented design patterns

4. Object-Oriented thinking methods

(1) First determine who to do, followed by determine how to do

(2) First consider the whole, then consider the local

(3) First consider the abstract, then consider the specific

5. What is a class

A class is a blueprint or prototype that defines variables and methods for all objects of the same class

6. How to create a class

Class name

{

attribute;//member variable, mainly used to describe the state of a class

method;//is also called a member method, mainly used to describe the behavior of a class

}

Such as:

                  

Class Dog

{

String name;//Property

int age;//Property

String color;//Property

Method

void Jump ()

{

}

void Brak ()

{

}

}

7. What is the image of

A fact that exists in kind, such as a dog, a computer, a tree ...

8. How to create an object

Methods for generating objects

Format: Class Name Object name = new class name ()

Dog dog = new Dog ();

public class Test

{

public static void Main (String [] args)

{

Scanner input = new Scanner ();//Create and declare a Sanneer object

 

}

}

The Java language's object-oriented concepts and basic knowledge of classes and objects

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.