1. Bubble sort: (interview often)
Static voidBubblesort (int[] a) {inttemp; for(inti = 0; i < a.length-1; i++) { for(intj = 0; J < A.length-1; J + +) { if(a[j]>a[j+1]) {temp=A[j]; A[J]=a[j+1]; A[j+1]=temp; } } }}
2.String processing String Common methods
int length ();--Get string length-----and set distinguish, int size ();
int indexOf (string str);--Returns the first occurrence of the index in this string
Boolean equalsignorecase (String another);--Comparison of two strings, case-insensitive-----Verification Code
String subString (int beginindex) gets a string, starting from Beginindex to the end
String subString (int beginindex,int endIndex) Gets a string, starting at Beginindex to the end of EndIndex (not including the character EndIndex)
String[] Split (string regex) splits the string, returning the segmented array of strings
3. Inheritance, encapsulation, multi-state Simple summary
Inherited:
Code reuse is implemented through inheritance. All classes in Java are obtained by inheriting the Java.lang.Object class directly or indirectly.
Inherited classes are called subclasses, and inherited classes are called parent classes. Subclasses cannot inherit member variables and methods in the parent class that have access rights private.
Subclasses can override the parent class's methods and name member variables with the same name as the parent class.
However, Java does not support multiple inheritance , which is the ability of a class to derive from multiple classes of superclass.
Encapsulation: Property privatization, providing getter and setter access to private properties ----common
three prerequisites for polymorphic presence :
First, to have inheritance;
Second, to have a rewrite;
The parent class reference points to the subclass object.
4. Eight Package classes
5. Packing and unpacking:
Http://www.cnblogs.com/dolphin0520/p/3780005.html
Summary of Java Fundamentals (i)