J2SE Base-3

Source: Internet
Author: User

Object oriented
Objects and classes
Staff Category: Staff a staff B ....

Relationships between classes
Association Relationship: Association Relationship (weak)
Inheritance relationship: xx is a kind of xx (tree)
Athletes
Ball Players
Football player
Aggregation relationship: XX is part of XX (Whole and part)
Gather team = Captain + player
Combination person = Body +head
To implement a relationship:
Pet Care <<interface>>
Polymorphic:
Print

Java and object-oriented
Everything is Object
Object = member Variable + method
Class is a template
Dog.java
public class dog{
int furcolor;
float height;
float weight;
void Catmouse (Mouse m) {
M.scream ();
}
}

Definition of Java class
Member variables
Reference type new object performance in memory code seg heap SEG Stack

Construction method
Class name () {}
Use with new
Overriding construction methods
Customary naming conventions
Class name first Letter capital
Variable method first Letter lowercase
Hump marking

Memory analysis
Test. Java class birthdate{}
Testpoint.java
Stack Memory---> Heap memory

J2SE Base-3

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.