Chapter 1 of Java and chapter 1 of java

Source: Internet
Author: User

Chapter 1 of Java and chapter 1 of java

The day after tomorrow is the 11th holiday. Are you ready to go?

Today is a bit blank. Let's talk about Java. Of course, there are a lot of Java beginners. Here I just list some of what I learned, thank you for your attention to Meow's blog for so long. It also brings you some new knowledge. You must believe that you have learned one by one every day. Although there are few, slowly, you will become a giant in this industry, on the premise that you have to persevere.

1. Class and object?

Class: an abstract set of objects with the same features (attributes) and behavior (methods.

Object: the current type of the class (the specific example in the class ).

2. Object-oriented?

Object-oriented: a programming idea centered on objects, driven by events, modular functions, and independent from each other.

3. What are the attributes of an object?

Attributes of an object: various features of an object.

4. Object method?

Object method: executable behavior of an object.

5. What are the relationships/differences between classes and objects?

A: classes are abstract concepts and objects are specific examples.

6. Define a class (Java )?

Composition: attributes and methods.

Step: Define the class name (uppercase)

Write the class attributes;

Compile the class method.

Steps for using objects:

1. Create an object and instantiate it.

2. Objects used

  

7. member variables and local variables?

Member variable: defined in the class to describe what the class will have.

Local variables: defined in the class method. Data is saved temporarily in the method.

Difference: the scope of a member variable is visible throughout the class, and the scope of a local variable is limited to the method that defines it.

Different initial values: member variables are assigned an initial value, while local variables are not assigned an initial value.

Local variables with the same name are not allowed in the same method. Local variables with the same name are allowed in different methods.

When the two variables have the same name, the local variables have a higher priority (proximity principle ).

Now, we are here today. Thank you for your support. I will continue to write articles for you. I hope you will like them and pay more attention to me.

Thank you for your support!

My short book is: http://www.jianshu.com/users/795c2ec428fd/

  

  

 

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.