Java Review Summary 1

Source: Internet
Author: User
Tags java se

Java System Review
Base Core Java SE
Java EE, based on Java SE, is mainly used for large-scale enterprise application development
Also divided into another piece of Java ME, mainly for the development of embedded
JVM (Java Virtual machine) Java VM
The Java language cross-platform is implemented by the JVM
Jdk:java Development Kit (Java Development Kit)
Jre:java Runtime EnviR (Java Runtime Environment)
Java Development Environment Building
First step to installing the JDK
Second step to configure environment variables
Step three Verify that the environment configuration is successful
Using Notepad
Command: Javac Helloworld.java generate a. class file
Running: Java HelloWorld
Developing Java program procedures using the IDE
1 Creating a Java Project
2 Creating Packages
3 Writing Java source programs
4 Running Java programs
Porting of programs
Print, println, the output is not wrapped, the latter output line-wrapping
Breakpoint Debugging
F6 Single Step execution
Object oriented
The concept of objects
What is object-oriented
Class
Properties of the Object
Methods of the Object
Class-to-object relationships/differences
The concept of objects: Objective things are objects,
Class: A class is a mold that determines the characteristics (attributes) and behavior (methods) that an object will have
Class Characteristics: A class is the type of an object, a collection of objects with the same properties and methods
Properties of objects: objects have various characteristics, each of which has a specific value for each property
Method: An action performed by an object
Class and object relationships: Classes are abstract concepts, just templates, objects are a
Tangible entities that can be seen and touched
Defining classes
The importance of classes: All Java programs use class classes as organizational units
What is a class: A class is a mold that determines the characteristics (attributes) and behaviors (methods) that an object will have
The composition of the class: Properties and Methods
Steps to define a class
1 Defining class names
2 Writing the properties of a class
3 Methods for writing classes
To work with objects:
1 Creating objects
Class Name Object name = new class name ();


2 Working with objects
member variables and local variables
Member variables
Defined in a class to describe what the object will be, the member variables are used in methods of this class, and other classes can be used
Local variables
Defined in a method of a class, temporarily saving data in a method, only in the current method
The difference between a member variable and a local variable
Different scopes
The scope of a local variable is limited to defining his method
The scope of a member variable is visible within the entire class
Different initial values
Java will give the member variable an initial value
Java does not give initial values to local variables
Local variables with the same name are not allowed in the same method
In different methods, you can have local variables of the same name
Local variables have higher precedence when two types of variables have the same name
Construction method
1 Create a new object by using the new + construct method
2 constructor method is a method that is defined in the Java class to initialize the object
The constructor method has the same name as the class and no return value
When no construction method is specified, the system automatically adds an argument-free construction method
When there is a specified construction method, no parameter is automatically added to the construction method, no matter whether it is a parameter or no argument
Overloading of constructor methods: multiple methods with the same method name but different parameters, automatically selecting the appropriate method according to different parameters
The construction method can not only assign values to the properties of an object, but also guarantee a reasonable value to the object's properties.

Java Review Summary 1

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.