Java_day06 (Java-based and object-oriented, two-dimensional array and object-oriented basis)

Source: Internet
Author: User

1: Two-dimensional array (understanding)
(1) The element is an array of one-dimensional arrays.

(2) Format:
A: Data type [] Array name = new data type [m][n];

M indicates how many one-dimensional arrays of this two-dimensional array

n represents the number of elements per one-dimensional array

The following format can also represent a two-dimensional array: It is not recommended to use

Data type array name [] = new data type [m][n];

data type [] array name [] = new data type [m][n];


B: Data type [] Array name = new data type [m][];
C: Data type [] Array name = new data type [][]{{...},{...},{...}};
D: Data type [] Array name = {{...},{...},{}};
(3) Case (Master):
A: Traversal of two-dimensional arrays
B: Sum of two-dimensional arrays
C: Yang Hui Triangle

2: Two study Questions (understanding)
(1) Problem of parameter Passing in Java
Only values are passed in Java.

Basic type: Changes in formal parameters do not affect actual parameters
Reference type: Changes in formal parameters directly affect actual parameters
(2) Data encryption issues
Synthesis of small cases.

3: Object-oriented (mastering)
(1) Object-oriented
Object-oriented is a process-oriented programming idea
(2) Object-oriented thought characteristics
A: It's a thought that's more in line with our thinking habits.
B: Simplifying Complex things
C: Let's turn from the executor to the conductor

Example:
Buy a computer
Washing clothes
Cook
...
Everything is object.
(3) Load the elephant into the refrigerator (understanding)
A: Process-oriented implementation
B: Object-oriented implementation

Note: How do we make our operations more consistent with object-oriented thinking?
A: What are the classes
B: What are the members of each class
C: Class-To-class relationships
(4) Classes and objects
A: Things in the real world
Basic description of a property thing
The function of a behavioral thing
The most basic unit in the B:java language is the class. So, we're going to use classes to show things.
C: Class
member variables Things properties
Member Methods thing behavior
D: Class: Is a set of related properties and behaviors. is an abstract concept.
Object: is the concrete existence of this kind of thing, is a concrete instance. Object

Example:
Student: Class
Monitor: Object
(5) Definition and use of class
A: Definition of class
The member variable definition format is the same as before, where the location is different, in the class, outside the method.
The member method definition format is the same as before, which is to remove the static.
B: Use the contents of the class
A: Create an object? Format
Class Name Object name = new class name ();
B: How do I use member variables and member methods?
Object name. Member Variable
The name of the object. Member method ()
(6) Case:
A: Definition and use of student class
B: Definition and use of mobile phone class
(7) Memory diagram
A: Memory diagram of an object
B: Memory diagram of two objects
C: Memory diagram of three objects
(8) Development, design, and characteristics of Java programs
A: Development: Is the constant creation of objects, through the object call function
B: Design: To manage and maintain relationships between objects
C: Features
A: Package
B: Inheritance
C: polymorphic

Java_day06 (Java-based and object-oriented, two-dimensional array and object-oriented basis)

Related Article

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.