Java summary of the second week

First, build the Java programming environment

To learn Java, a natural first step is to build a good Java programming environment, install JDK and JRE. I search the Internet environment to build tutorials, mostly the result of the old version of the tutorial, and now the process of configuring the latest version of the JDK installation does not meet, resulting in the normal input output java version java -version, actually compile time and errors. Later, assistant watch instructional videos, and the combination of online search, JDK12 that comes with JRE, no need to install, configure only successful environment. This shows that the development of information technology is still very fast, the Internet is likely to have a lot of information out of date, you need to identify themselves.

Second, learn the basics of Java

1. & and && difference?
&: Logical AND (and), both sides of the operator when the operator expressions are true, the result was a whole is true.
&&: short circuit and, if the first expression is false, the second expression will not be calculated.

2. How out of the current multi-loop in java?
Outside the loop defined above in a label, then label with the break statement in the code in the loop body layer, can be out of the loop.

3. Object-oriented features?
Package: The code object properties and methods into a module package, a class, i.e., to ensure excellent internal software of the base module, to achieve "high cohesion and low coupling."

Abstract: find some similarities and common place things, then classified as a class at only consider the similarities and commonalities of things. Including abstract behavior and abstract state of abstraction.

Inheritance: class conducted on the basis of already existing on the contents defined as its content, and can add new content or modify the original method is suitable for special needs.

Polymorphism: the same operation applied to different objects can have different interpretations, produce different execution result, is polymorphic, simple point that: the parent class is to use an object reference pointing to subclass. Objective: To improve the reusability of the code, solve the problem of tight coupling projects, improve scalability.

Polymorphic mechanisms: by the parent or reference variable interface or may be directed to a subclass of object class instance of the specific implementation.

4.java garbage collection
GC is a garbage collection mechanism is used to free memory resources.

Garbage collection can effectively prevent memory leaks, effective use of free memory.

Third, the problems encountered in the job

The PTA is the first time the job although the job, but the difficulty is not low for me. When submitting the first question there is a problem, the compiler I have always displayed an error (Main.java:1: error: public class IS The Rabbit, Should BE A File named Rabbit.java declared in
public class {The Rabbit), after the discovery class name must be Main, in order to arrive at a correct answer. Another point, because to use the Scanner class, so these must be imported, import java.util.Scanner; this one is indispensable.

IV Summary

This semester I personally think that Java is more difficult than the C language more difficult to learn, to be more serious about the job.

Guess you like

Origin www.cnblogs.com/ITSkystudio/p/11488442.html