Java Fundamentals (Knowledge points)

Source: Internet
Author: User
Tags thread class try catch

1.java has classes of overrides and overloads of 2 kinds: overloading is the same class, the method name is the same, the parameter differs from the method, and the overriding is that the subclass inherits the parent class method, and the rewrite (@Override) "Note" OC does not overload only overrides, and is also called overload  2.static: denotes the meaning of the class If the property is decorated, this property is a global property, and all of the member variables are of the same value, and the method is a class method, and the class method can only invoke the Class property;  3 non-static code block think of a constructor without parameters, A static block of code (statically decorated) executes first and executes only once (when the class is loaded)  4.extends: Inherit keyword  5.final: The final, modified Property-> cannot be modified; Adornment method---cannot be overridden; Decorated class-& Gt Cannot be inherited, extended;  6.abstract: Abstract; Modification method: No method body, only method declaration (abstract method); Modifier class, cannot be instantiated (abstract class) PS: The class of abstract method must be abstract class, but abstract class inside not necessarily have abstract method  7. Interface Definition Interface   Implement implementation Interface PS: A class can implement multiple interfaces, multiple interface implementations with "," separate  8.try catch   exception handling mechanism finally   Throws throws an exception  9. Property modifier: Scope             Current class   inside package   Descendant classes       Other packages  public               √           √              √             √ protected        √             √           √           x default            √             √           x             x private             √            x           x            x  10. Set (collections) set unordered, not repeatable list ordered, repeatable map key value to  11.iterator recursion (It.hasnext  it.next ()) (enumeration);  12.instanceof determines whether an object belongs to a class (true belongs to), example: ( o instance person2)  13.treeset self-sorting function(You can sort by a supported type for itself-default ascending)  13.1 can be used for the specified element, the function of the custom sort:  The element itself has a comparative implementation comparable interface   overlay CompareTo Method- Element inside Write method CompareTo return 0: equal; negative: current element is small; integer: current element large  13.2 Creating comparator, implementing custom sorting externally, attributes do not need to be implemented14.properties Properties File 15.collection.synchronizedlist () method to get a thread-safe collection of 16.IO streams: InputStream fileinputstream Bufferedin        Putstream objectinputstreamoutputstream FileOutputStream Bufferedoutputstream objectoutoutstreamreader                               FileReader BufferedReader Inputstreamreaderwriter FileWriter BufferedWriter outputstreamwriter 16.1.serializble object's input and output stream, the object implements the version number of this interface class: Serialization 16.2 for Objects Randomaccessfile , there is a pointer to the contents of the file, moving the pointer through the Seek () method 17. Common class 17.1 String immutableStringBuffer (thread-safe), StringBuilder (thread unsafe) variable string17.2 Date DateFormat 18 Reflection class, is a class to look in the mirror, get class There are three methods, commonly used in a full-class name method to obtain a description of the class Field: Property method: Methods Consort ctor: Constructor 18. There are 2 ways to implement Multithreading: 1. Inherit the thread Class 2. Implement Runnable interface

Java Fundamentals (Knowledge points)

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.