Day 1: Java core knowledge point summary

Source: Internet
Author: User

Corejava knowledge point:
1. IDE (myeclipse)
Project name: All in lower case (meaning). Words are separated by underscores;
Package name: Same as the project name;
Class Name: the Hungarian naming method.
2. API specifications:
JBoss sun
Tomcat6.0 Apache
WebLogic Bea
WebSphere IBM
3. knowledge points:
(1) Object-oriented OOP
Encapsulation: encapsulate all data-forming members and Member methods in one class, providing only one interface (external blocking), high cohesion, and bottom coupling.
Inheritance: extends (single), implements (multiple)
Private cannot be inherited
Same type and same package as default
Similar protected, same package, and different packages
Public
Override of the override method. The method name is the same, the parameter type and number are the same, and the access modifier is the same as the parent class or larger than the parent class.
Subclass instantiation process:
1) first call the construction method of the parent class, load the parent class attributes, and then load the static code of the parent class quickly;
2) Allocate space for this class and Load Static code for this class quickly;
3) initialize the attributes of this class;
4) Call the constructor of this class.
Polymorphism: the object of the parent class points to the reference of the sub-class and is polymorphism at runtime.
1) The object runtime type remains unchanged;
2) Find the overwriting method for the specific runtime.
(2) classes and objects
(3) common classes
Bytes
String
Stringbuffer
Stringbuilder
(4) Set
Collection (Interface)
|... Set (Interface) [unordered and repeatable]
|... Hashset
|... Treeset
List (Interface) [sequential and repeatable]
|... Arraylist
|... Sort list
|... Vector
Map (Interface) [duplicate keys and repeated values]
|... Hashmap
|... Hashtable
Iterator)
Map Iteration Method 1: (keyset iteration)
Set tmpset = curmap. keyset (); // returns the sequence of keys.
Iterator <E> it = tmpset. iterator ();
While (it. hasnext ()){
Object 0 = it. Next ();
}
Method 2 of map iteration: (entryset iteration)
Iterator <map. Entry <K, V> it = map. entryset (). iterator ();
While (it. hasnext ()){
String key;
String value;
Map. Entry entry = (Map. Entry) it. Next ();
Key = entry. getkey (). tostring ();
Value = entry. getvalue (). tostring ();
}
Collections (class)
(5) Exceptions
1) custom exception:
2) catch exception: Try {} catch () {} finally {}
3) Handling exceptions: throws (negative) and try... catch (positive)
4) The exception of calling the main () method is directly returned to the JVM.
5) New exception throw
(6) Regular Expression
^ Start $ end
/D Number/d Non-Number
/W letters/W non-letters
+ 1 ~ N * 0 ~ N
? 0 or 1
[A-Z] {n,} The number of consecutive occurrences of the preceding content is greater than or equal to n
The content before {n} must be n
Before {n, m}, the content must be greater than or equal to N and less than or equal to M.
{} Represents a whole
| Or

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.