Java Top three Basics summary

Source: Internet
Author: User
Tags bitwise modifiers java se

Basic software:
1:JDK,JRE,JVM (some parameters and functions), GC (mechanism and algorithm), Class,loader (machine action, load order)

2: Environment Construction: Java_home,path,class

Language Basics:
Reference type: Class, interface, array (first create object, then reference)
Basic type: Numeric integer byte,short,int,long, float type float,double, character char (how to deposit and how to get it). Focus

Memory Size: Group small value and maximum value
Integer: The default is int, float type default is double float f = 3.14; Character type default value 0, ' \u0000 ' is not ' 0 ', bollean default False

Base type size: Byte<short<int
Char<int
Int<float<double


An operator, an expression:
Arithmetic operator: +-/%

Comparison operators: <,<=,>,>=,==,

Logical operator:! , &&,| |,^ (bitwise operator) &,|, (can also use) to find a way!

Bitwise operator:~,&,|,^,>>,>>>,<<

Trinocular operator:? :

Statement:
If
Switch

For (used when the number of loops is clear)
The foreach for (int i:ia) traversal is used.
While
Do...while
What kind of cycle is used?
Use a dead loop when you don't know.

Array:
Defined:
Features: contiguous collections of elements in memory that are continuous and of the same type.
Action: Define, create, assign (go back and check)
Element assignment, sort (colon, insert), find (sequential, binary lookup), traverse, insert (the array length is fixed (fixed to have a new array returned)), delete (), copy? (3 kinds), upset ()
Functions (Prerequisites and results) and data () (Methods (parameters and return values) and)


Object-oriented:
Concepts: Classes, objects, instances, references.
Programming Ideas:
Three:
1 have the state, the object of the method,
2 Description Class
3 to interact.
Idea: Define classes: Except basic, emphasis on modifiers, access modifiers (3): Use it yourself and give it to others. protected for inheritance. Properties are generally private wrappers.
Static: Compiling, recording is used. Class: Conversely, at run time (static loads are common to objects belonging to classes in a class, statically cannot be called because they are static at compile time, not static at creation time).
Classes: Concrete classes and abstract classes. (the more abstract the higher the level), the (concrete and abstract) final (the final decorated class, property, method, but cannot be inherited, overridden.) ) ABSTRATC
Interface:
Inherited:
8 Large: Synchronized,native (c language used, defined in Java, but implemented in C), STRICTFP,

Created object: is for the construction method after new (t name = new T ();) Construction method: characteristics, static out of the initial block, static initial block, construction. Call the construction method (and method) in the order you created the object.
Construction: The general function is to initialize the instance properties,
Inter-object Communication (interaction): How powerful Members and class members call each other, class. class member, instance. Strength member.

Relationships between classes and classes: There is a () and is a (is inheritance and implementation) class is single-inheritance, multi-interface.

Encapsulation, inheritance, polymorphism. Check

Interface: 1 definition 2 used.

Object-Oriented implementation principles: 1 for interfaces rather than for implementation programming, 2 prioritizes the use of combinations rather than using inheritance programming. (can use one and try not to be one)


Project:
Hello World

Configuration file:

Mapping files: Links between tables and entity classes


Projects:: Rack packages and drive packages

Com.mapper.TelMapper

1. Build a library, build a table.
2. Create a new project and pour into the jar package.
3. Entity class Pojo.user (the class name of the entity class is user, the table name is users)--note the relationship between column name and attribute name
4. configuration file Mybatis.cfg.xml placed under SRC,
The 5.mapper interface and mapper XML (Xxxmapper.java xxxmapper.xml) are placed in a package to match the relationship.
6. Testing the class test. Main

Elements, attributes, text

Insert Modify Delete query (all, custom query)


Read the book Tomorrow (MyBatis) tell the teacher!

Two hours in the morning. (Java Foundation and database)

2016-3-4
The assignment was understood yesterday.
Dynamic query to do an example
Read a book: Java Persistence MyBatis3 (today) (#{},${} check)

Java SE
Three main features:
Java exception Handling: 1 for abnormal condition description (Exception statement) 2 What is this exception class handling.
Exception classification: (book on page fifth): (examined and not inspected is said compiler) 1: Detected abnormal checked exception
2: Non-detected exception unchecked exception (runtime exception runtimeexception, error err)
Error unrecoverable (compilation exception)
Run exception (code logic is problematic)

Exception Architecture: The book has:


Exception handling: try...catch....finally, writing form, execution flow
Throws Xxxexception, writing form

Custom exceptions: Inherit from exception (typically application exception)

Thread
Concepts and Features: separate, concurrent, code snippets
Implementing Threads: Inheriting thread, overriding the Run method;
Implement the Runnable interface to implement the Run method (this class is thread or similar)
The Common Api:sleep,currentthread,start
Status of the thread: Figure painting (book 147)
Thread synchronization: Method one to implement. A class locks an object one lock, and only a thread with a lock can enter the synchronization area.
Thread Safety:?
Thread communication: Wait,notify,notifyall.

IO stream: java.io The function of the class in the package: input and output.

Stream classification:
Byte stream, character stream,
Input stream, output stream,
A node stream (typically a specific file) can handle only the basic unit of read and write, processing a stream (with a concept that is not specific) (processing read-write non-basic node units).

BYTE stream (8-bit) character stream (16-bit)
Input stream InputStream Reader
Output stream OutputStream Writer


Programming models for streams: books (87)
FileOutputStream fos=new fileoutputstream (filename)
DataOutputStream dos=new dataoutputstream (FOS)


Fos.writeint (We); X (not the basic type does not have this method)

Dos.writeint (We);

Dos.close ();
Fos.close ();


Set: The whole of an element within a certain area.
Can only be stored objects (element types are the same). (Array: Objects and elements. )

Illustration of a collection: Book 55
Requirements: iterators are used, and enumerators are used.
Use enhanced for loops for collections (can be converted to iterators)

List features (ordered,)
Set Feature (unique)
Queue queues ()
Map key-value pair mapping ()

Haskoude
Tool class:
Arrays.fill (ia.1)
Arrays. Sort (IA)

Collections.sort (list)

(Comparable (generally available for comparison), Comparator ()) 1: Generally used to sort
Differences: 1 Whether it is necessary to use the 2 definition class is externally seen when the internal rule is to be compared with the internal rules that are used in a 3-able, external rule is


Generic: (Run-time only when run at compile time) 1 elements of the same type
2 Type Erase:


The third part: what, how to use.

Springmvc

1 Client
2 server-side
3 Back to Client
4.xml


1, client--"2 controller-" 3 Hello-"4web.xml configuration (Controller) <component-scan basepackage=" Controller ">-->spring Framework (for controller)--" XML configuration (Find Controller)-->action--> back to Client
<bean class= "Org.sppringframework.web.servlet.view.InternalResourceViewRwsolvwe" >--analytic view
<param prefix= "/" >
<param suffix= ". jsp" >
</bean>
/index.jap


5.web.xml

<servlet>
<servlet name>springmcv</servlet-name>
<servlet-class>


1.Input page
2.Controller
3.Output page
4springmvc-servlet.xml
5.web.xml


@Controller Note the following method can handle things


Binding of parameters in Springmvc
Login page and Registration page

2016-3-5 KEY!!!!!
Jdbc
Role
Programming Model:
1. Load driver (can not write), create link, create statement, execute statement, (convenience result, close result set (can not write)), disconnect data connection. ----(must be written out!) )

Network programming:
UDP-based datagram programming
Programming Model:
Code:
Sender: 1 Create data
2 Creating a port number
3 Creating a Send address
4 Sending data and shutting down


Receiver: 1 Create a Receive port number
2 Creating a package to receive data
3 receiving data with the receiving packet
4 Data processing and closing


TCP/IP-based socket programming:
Programming Model:
Code:
Server side: 1 Turn on monitor (book 196 code) ServerSocket SS New ServerSocket (999);
2 Waiting for Client link Socket s=ss.accept ();
4 Get stream S.getinputstream, S.getoutputstream
5 Read and write operation Is.red/os.write
6 closing the stream and socket Sclose
7 Close ServerSocket Ss.close
Client: 3 Client connection Socket s = new socket (ip,999);
4 S.getinputstream, S.getoutputstream
5 Is.red/os.write
6s.close


XML: Parsing
Concepts: Elements, attributes, text
dom4j
Job: There are several frameworks:?
How many resolutions?
How to parse XML using DOM4J


Reflection:
Concepts and functions: When you have a class name, you can create objects and invoke methods at run time, and get tired information.
1 How to create an instance with reflection, 2 how to use an instance, and 3 how to manipulate the method.
Programming Model: Write it Out

Note: (What to use, common annotations, several original annotations to understand) at compile time this piece of code has the specific processing.
Common annotations: @Override overrides, @Deprecated compile without using @suppresswarnings warnings


Junit:
(Will:/testng (better than junit, usage is basically the same.) ))


public class test Class {
@Test
void F () {
A a=new a ();
Assert.equals (A.ass (2.2), 4);

}


}

Afternoon:
Ssm:
Login:
1 entity classes
2apper
3service
4iuput page
5controller
6output page
7xml: (Web. XML,)
8springmvc-servlet.xml

Java Top three Basics summary

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.