h--5--spinach Source download Java basic concept

Source: Internet
Author: User

1. First Application: Hello world!
Package MY.XKYY.LSC;
public class HelloWorld {
public static void Main (string[] args) {
System.out.println ("Hello wrold!");
}}
2. Array: int[] a=new int[100];
3. Bytes (byte): 8-bit binary number
4.UTF-8 encoding: An English character equals a byte, h--5--spinach source download qq:2152876294 url diguaym.com A Chinese (with traditional) equals three bytes.
Chinese punctuation is three bytes, and English punctuation is a single byte.
5.ASCII code: An English letter (not case) occupies a byte of space, a Chinese character occupies two bytes of space.
6. Tool class: String:string s= "SSS"; String S1=new string ("SSS");
S.equals (S1);//Determines whether the string contents are the same. "= =" cannot be used (because the address is different);
S.substring (0,1);//string interception, which contains the previous not included.
S.comparetolgnorecase (S1) >0;//s in front, <0 s in the rear. Case is ignored.
Formatted output: Format method
7. The method area and heap memory are thread-shared.
program counters, virtual machine stacks are thread-isolated.
8. The interface method is public abstract by default, and the corresponding method in the class that implements the interface is visible
cannot be less than the visibility of the interface method, and therefore can only be public.
9. Heap holds object instances where almost all object instances allocate memory
10. Method area stores class information that has been loaded by the virtual machine, constants, static variables,
Real-time compiler compiled code and other data
11. The ASCII code value of the space is 32;
The ASCII values of the numbers 0 through 9 are 48 to 57, respectively;
The ASCII values of the uppercase "A" to "Z" are 65 to 90, respectively;
ASCII values from lowercase "a" to "Z" are 97 to 122, respectively
12. Overloads are in the same class, with multiple method names and different parameter lists
(different number of parameters, different parameter types), regardless of the return value of the method, regardless of the permission modifier
13. Subclass a inherits the parent Class B, a A = new A ();
Parent Class B Static code block, subclass a static code block, parent class B non-static code block,
Parent Class B constructor, subclass a non-static code block, subclass a constructor
14. The construction method does not return a value. The construction method must have the same name as the class that is defined as public
Construction methods cannot be called by an object, only objects are created, using the New keyword
15. Original data type: Double float long int String short Boolean byte.
16. Thread Lock concept: Synchronized keyword, for this method lock, the equivalent of whichever
Thread (for example, thread a), when running to this method, check that there are no other threads B (or C, D, etc.)
This method is being used (or other synchronization methods of the Class), and some words wait for the Synchronized method to be used
Thread B (or C, D) runs this method and then runs this thread A, without locking the caller and then running directly.
17. PIPE: Pipe is a half-duplex communication mode, the data can only flow in one direction, and only in the relationship
Inter-process use. A process's affinity usually refers to a parent-child process relationship.
18. The operator */'/'/+ is available for float and double. Only% take-out operation, only applicable to integral type
The types of 19.Java programs are: (a) embedded in the Web file, viewed by the browser _applet
(b) Application (c) server-side servlets that can be run independently
20.java.math in Ceil: is greater than or equal to X and is the nearest integer to it.
Floor: The integer that is less than or equal to x and closest to X.

Next Java Basics Exercise Summary 1

h--5--spinach Source download Java basic concept

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.