A talk on basic Java knowledge

Source: Internet
Author: User

1, extends is inherited from a class, after inheritance can use the parent class method, you can also override the parent class method; Implements is to implement multiple interfaces, the method of the interface is generally empty, must be rewritten to use, implements can implement multiple interfaces separated by commas can be

2. Array Goto List

String[] words = {"ace","boom", "crew","dog", "eon"};

    List<String> wordList = Arrays.asList(words);
3、java分隔符
   String s="1,2,3,4";
   String m[] = s.split("\\, ");

4、什么是框架

    The framework is just a jar package, which is essentially an extension of the functionality of the JDK to solve a domain problem.

Best practices: In fact, countless programmers have, after countless attempts, summed up specific methods of dealing with specific problems.

5. What's the three layer frame

From the macro point of view, the most important web development model is the layered development model, the entire program according to functional responsibility of the vertical division, a more typical division method is to divide the program into: the presentation layer, the business layer and the persistence layer, the so-called three-tier architecture.

Presentation layer: Handles functions related to interface interaction.

Business layer: Responsible for complex business logic calculations and judgments. For example: Some validation work: ① does not allow the text box to enter the specified string ② data format is correct and data type validation ③ the legality of user rights and so on.

Persistence layer: Responsible for persisting storage of business logic data. The persistence layer serves the business logic layer, and the business logic layer operates on the object, and the database is the relational database. The persistence layer masks the tables and fields and turns them into objects to pass to our business layer.

Struts2 is the frame of the presentation layer

Spring is the framework of the business layer

Hibernate, Ibatis is the framework of the persistence layer

6. If a method is used multiple times in the development process, the abstraction will be written as a tool class, such as JSON encapsulation in web development, date formatting, etc.

7, Struts.xml Import other sub-XML file with <include file= "Xxxx.xml"/>

Spring Config file Imports additional sub-files with <import resource= ""/>



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

A talk on basic Java knowledge

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.