Download Java and java Official Website
Java is a "pure" object-oriented language.
The operation identifier is a reference of the object, and new is to create an object.
Storage location: Register \ stack (reference) \ heap (new) \ constant storage (internal program code) \ non-RAM storage (Stream object and Persistent Object ).
Basic Type: storage space size immutability (easy to transplant)-automatic packaging function.
High-Precision numbers: BigInteger (integer of any precision), BigDecimal (decimal of any precision ).
Array initialization: the object array is set to null. If you reference the array, an error is returned. for basic types of arrays, the memory is set to 0.
Java is a free format (that is, "{}" scope), and an object is created by new.
Java has a garbage collector to monitor all objects created with new, and identify objects that will not be referenced again to eliminate memory leaks.
The keyword class indicates the class. Data members and member functions.
If the data member is a reference to an object, it must be initialized to the actual object.
If the data member is of the basic type, Initialization is performed by default, but local variables are not initialized and an error is reported.
The program seems to be a combination of objects with methods. The methods take other objects as parameters and send messages to other objects.
In turn, the class library uses its own Internet domain name, and the package name is in lower case.
Java removes forward references. import a package or class library and use "*" to indicate all classes.
Static keyword. objects of a class can also be created using static methods and data.
Using the class name is the preferred method to reference static variables and methods.
The static method is similar to the "Shepherd", which is responsible for nursing instances of the same type.
import java.util.Date;public class Main { public static void main(String[] args) { System.out.println("Hello, it's: "); System.out.println(new Date()); }}
Import must be declared at the beginning of the file. java. lang will automatically import each java file.
/*** Display attribute * Created by wangchenlong on 15/7/5. */public class ShowProperties {public static void main (String [] args) {System. getProperties (). list (System. out); System. out. println (System. getProperty ("user. name "); System. out. println (System. getProperty ("java. library. path "));}}
Notes and embedded documents:
@ See: The Link References other classes.
{@ Link package. class # member label}: used for intra-row link reference
{@ DocRoot}: relative path of the document root directory
{@ InheritDoc}: inherits the document annotation
@ Version: version Information
@ Author: author Information
@ Since: early version of program code
@ Param: Parameter
@ Return: return Value
@ Throws: exception
@ Deprecated: abandoned, new version @ Deprecated
//: object/HelloDate.javaimport java.util.Date;/** * Display a string and today's date. * @author C.L.Wang * @author Caroline Wendy * @version 4.0 */public class Main extends ShowProperties { /** * Entrv point to class & application. * @param args array of string arguments * @throws java.lang.Exception No exceptions thrown */ public static void main(String[] args) { System.out.println("Hello, it's: "); System.out.println(new Date()); } /** * Output: * Hello, it's: * Sun Jul 05 21:32:28 CST 2015 *///:~}
Encoding style:
Camper style-the first letter of the class name is in upper case, and the first letter of the method is in lower case.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.