Java basic statement

1. Loop statement, for while do-while foreach

2. Conditional statement: if switch

3. Constant final static variable static (static call with class name)

4. Objects call methods, classes call static methods

5. Inheritance (extends) inherit the variables and methods of the parent class

  Abstract (abstract) abstract methods in abstract classes and interfaces must be inherited or implemented

  Polymorphism: method overloading (method parameters and constructors are different) and overriding (inheriting the parent class, the same parameters, the same method name)

6. Interface: can only be instantiated by the implementing class

7. Array: fixed length

  List : Unfixed length, unordered, add add(), delete (use remove in iterator)

  Map: The length is not fixed, ordered, and the Map collection is operated through key-value pairs, adding put(), deleting remove()

8.String: string constant,

   StringBuilder: String variable, thread unsafe,

   StringBuffer: String variable, thread-safe

9.Date: parse() string to date, format() date to string SimpleDateFormat: date format.

   Calendar: Calendar is a more advanced date handling class

10. Exception handling try catch finally

11.jdbc operation database, basic steps

  1. Select database: load database driver
  2. Connect to the database
  3. Create database query
  4. Get query results
  5. Close query and connection

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325945818&siteId=291194637