[Java interview] basic knowledge, java interview
[Java interview] basic knowledge
Java basic knowledge summary, mainly including data types, string classes, sets, threads, time, regular expressions, streams, new features of JDK 5-8 versions, and so on. You are welcome to add some shortcomings. For source code sharing, see the personal announcement. JavaCommon Project
Basics:
(1) Basic Data Types
(2) operator operations
(3) Exceptions
(4) String, StringBuffer, and StringBuilder
(5) Number Type
(6) random number. Math. random ()
Set operation:
(1) List in the Set
(2) Stack in the Set
(3) Array in the Set
(4) Arrays class in the Set
(5) Set in the Set
(6) Map in the Set
(7) Collections class in the Set
Thread-related:
(1) synchronize Synchronized
(2) Multithreading
(3) ThreadPoolExecutor
(4) Volatile keywords
Others:
(1) Date-related
(2) Regular correlation
(3) Stream, File, and IO
(4) Serialize serialization
(5) network programming socket, TCP/IP, url
(6) send mail by email
Jdk5 features
Main features:
(1) automatic packing and unpacking
(2) Enumeration
(3) Static Import
(4) variable parameters (Varargs)
(5) Introspector)
(6) Generic
(7) enhanced for loop For-Each
(8) category class. Used to obtain user input
Features of JDK 6
Specific features:
(1) Compiler API. Dynamic compilation of Java source files
(2) Lightweight HttpServer. Http Server API
(3) Support for scripting languages such as ruby, groovy, and javascript
(4) [plug-in Annotation processing API] and Common Annotations
(5) Simplify Web Services.
JAX-WS (Java Architecture for XML-Web Services) 2.0. Xml-web service
JAXB (Java Architecture for XML Binding) 2.0. Ing between objects and XML
Streaming API for XML (STaX ). It is another API for processing XML after DOM (Document Object Model) and SAX (Simple api for xml ).
It provides a two-way API that can read or write XML data through an event stream, including skipping a part and directly following another part of the document.
(6) bind the Database to Derby. Bind the open-source embedded database Derby (JavaDB) to JDK 1.6
(7) richer Desktop APIs. Desktop and SystemTray. For example, support for the startup interface, support for system pallets, and JTable sorting.
(8) use the Console to develop Console programs
Jdk1.7 features
(1) The string can be used in the switch.
(2) automatic type inference
(3) numbers can be underlined.
(4) Support for binary text
(5) In try catch exception catch, a catch can write multiple exception types separated by "| ".
(6) Automatic Resource Management.
Before JDK 7, you must use the resource in try {} finally {} and close the resource in finally, regardless of whether the code in try Exits normally or unexpectedly.
After JDK 7, you do not need to write a finally statement to close the resource, as long as you define the resource to be used in the brackets of try.
(7) A warning is prompted when variable parameters are not specific.
(8) new tools and methods for retrieving Environment Information
Jdk1.8 features
(1) interface default method
(2) Lambda expressions
(3) functional interfaces: These interfaces that only have one method are called functional interfaces. Also called single abstract method type [FI]
(4) target type [TargetType]
(5) method reference
(6) Stream API
(7) Date API
(8) Optional Class