Crazy Java Handouts

Source: Internet
Author: User
Tags array length garbage collection goto modifier wrapper java keywords
Chapter One: Overview of the Java language A brief History of 1.1:java language 1.2:java competitors and their respective advantages 1.3:java program Operation mechanism1: Explanatory language advantage: Cross-platform is easier. 2:java is both a compiled language and an interpretive language
1.4 Preparation for Java development1:JRE contains JVM 1.5 First Java program1:javac syntax
javac-d Destdir Srcfile

The current directory is available. Represents 2:
basic rules for 1.6 Java programs1: Class is the smallest program unit in a Java Program 2: A class that has the main method can be executed by the interpreter 3:java the source program must be the same as the class name of the public class, so a Java source file can contain only one public class 4:java strictly case-sensitive 1.7 garbage collection mechanism1: Garbage collection can also erase memory fragments, in addition to releasing useless objects. Garbage collection can affect program performance. 2: When writing a Java program, one of the basic principles is that, for objects that are not needed, do not refer to them, can be assigned null 1.8 When to start using the IDE tool 1.9 Summary of this chapter Chapter Two: Understanding Object-oriented 2.1 Object-oriented1:java refuses to use Goto, but retains the GOTO keyword 2:java does not support multiple inheritance 2.2 UML Introduction 2.3 Java Object-oriented features Chapter III: Data Types and Operators1:java is strongly typed and has 2 meanings: A: All types must be declared and used; B: Variables of the specified type can only accept values that match the type 3.1 Notes1: Document Comment: Start with/**, end with/*
2: You can use the Javadoc command to automatically generate document annotations to the API documentation 3.2 Identifiers and keywordsP45:java statements can span rows, but a string, variable names cannot span multiple lines. The identifier of the P46:java language must begin with a letter, underscore, dollar sign, followed by any number of letters, numbers, underscores, dollar characters P46:java keywords

3.3 Data Type classificationP47:null can only be converted to a reference type and cannot be converted to a base type P48: Data type
P49: Octal begins with 0, 16 in 0x or 0X, binary with 0 B or 0b opening p51:float:1+8+23;double:1+11+52 P51: Floating-point numbers must contain a decimal point, or they will be treated as int P51:java plastic defaults to int, floating point defaults to double P51: positive infinity: positive_infinity, negative Infinity: negative_infinity, non-number: NaN, in class double or float P52: You can use the underscore in the value, whether it is plastic or floating point, you can use the underline freely, through the underline segmentation, can be more intuitive to distinguish the number of digits in the constant P53:java Boolean value can only be true or false, can not be used 0 or not 0来 representatives, Values from other data types cannot be converted to Boolean 3.5 Type conversions of basic typesP55: When you cast a floating-point to an integer, the decimal part of the floating-point number is truncated directly
3.6 Direct Volume 3.7 operatorP59: When dividing with floating-point numbers, divide by 0 or 0.0, the output is infinite, and the non floating-point situation runs out of the exception. P59: When the remainder operation is an integer, the second number cannot be 0, otherwise the division will divide by 0 exception. If a floating-point is included, the second is allowed to be 0 or 0.0, but the result is Nan. 0 or 0.0 for any number of the remainder is 0 or 0.0 P61: The assignment expression is a value, the value is assigned to the right of the value of the p62:>>> unsigned right P64: When the integer shift to type int a>>b, if b>32, the system will first use B to 32, By the same token, long is the first to 64.

Fourth Chapter: Process Control and Array 4.1 Order Structure 4.2 Branch StructureThe P75:switch expression can only be byte,short,char,int of these 4 and enumerated types, and java.lang.String 4.3 circulation structureP79:do-while, followed by a semicolon. 4.4 Control Loop StructureP85:java can use labels to break or continue the outer loop
4.5 Array TypeP86: An array is a reference type P87: Array length cannot be specified when defining an array P89: Array provides a property length P90: You cannot change the value of an array by using foreach 4.6 Deep Array the fifth chapter: Object-Oriented ( Part I) 5.1 Classes and ObjectsP106: If the programmer does not write a constructor, the system will provide a default, once written, will not provide P107: modifiers public,private,protected only one, abstract and final can only appear one P108: The return value of the constructor is not used in the hermit's p112:static decorated method, so static members cannot access non-static members 5.2 Method DetailedP115:java Pass parameter only value is passed 5.3 member variables and local variablesP127: After the local variable is defined, initialization must be displayed and the system will not initialize it automatically 5.4 Hidden and encapsulatedP130: Access control level is small to large: private,default,protected,public. The default modifier can be accessed within the same package
P134: Package is a logical path, not necessarily a specific path P135: A Java source file can contain only one package statement and multiple import statements 5.5 Depth Builder 5.6 Inheritance of ClassesP143:
5.7 polymorphicP149: The method has polymorphism, the object does not have polymorphism P150:
5.8 Inheritance and combination 5.9 Initialization BlockP157: The initialization block is executed implicitly only when the Java object is created, and executes the P157: normal initialization block before executing the constructor, declaring that the default value specified by the instance field is the initialization code of the object, and that their execution order is consistent with the order in which they are arranged in the source program. Using the static modifier becomes a static initial block, which is executed when the class is initialized instead of the object initialization.
Sixth Chapter: Object-oriented (second) 6.1 JAVA7 Enhanced Packaging classP163: In addition to character, other wrapper classes can use string arguments to construct P163:
P165: Although a wrapper class is a reference object, an instance of a wrapper class can be compared with a numeric type P166:
P166: Two Boolean comparisons, True>false 6.2 Processing ObjectsThe P168:object class provides a tostring method that always outputs the class name +@+hashcode P169:
6.3 Class Members 6.4 Final modifierP175:final decorated member variables must be shown by the programmer to specify the initial value P175:
P176: If the final-decorated local variable does not specify a default value when defined, then the final variable can be assigned an initial value, but only once, in the following code Squadron. P180:
The 8 wrapper classes and string classes provided by P180:java are immutable classes P185:
6.5 abstract class
P186: Abstract class has no method body without curly braces, directly with semicolons. Normal method body only curly braces 6.6 More thorough abstraction: interfaceP191: Defining a variable in an interface automatically adds public,static,final P195:
6.7 Internal classP199: Internal classes can access private data for external classes, but external classes cannot access the implementation details of internal classes

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.