Java j2se: learn more about java object containers and j2sejava object containers

Source: Internet
Author: User

Java j2se: learn more about java object containers and j2sejava object containers

Today is the first day of school. According to the lecture progress of the last semester, we should have been able to start to learn multithreading. However, due to the change of teachers, there may be some discrepancies in the handover, I also explained the java object container, so this is why the question is "learn again ".

Directory:

  

 

The main purpose of a Set: A set is usually used to query data returned. For example, to use jsp as a student information management system, you need to return the student query results from the database, put these results into a set, and then return the results through the method, in the display layer (view) jsp labels can be used to display them.

 

Single-value Collection: A single-value Collection includes List and Set. Both classes inherit from the Collection Root Interface. The two interface classes can be subdivided into several classes that implement the interface, mainly including the following:

List

 

Advantages

Disadvantages Features
ArrayList Quick and random access to a set Low deletion Efficiency Asynchronous

Shortlist

Easy to insert and delete objects Low random access efficiency -----

List iteration method: The get (Index) method can be used for iterative list, the enhanced for loop foreach can be used for iteration, And the iterator can also be used for traversal.

 

 

 

Set

     
TreeSet Ordered, natural number sorting, but must implement the Comparable interface, override the ComoareTo () method. Repeatable
HashSet Unordered, mainly based on equals and hashcode to determine whether it is the same object Repeatable
     

 

Set iterations cannot use the get method. You can use the iterator and the enhanced for loop to traverse.

 

 

Map

 

HashMap is a set of Key-value pairs. Duplicate keys are not allowed. One Key can only correspond to one value, but one value can correspond to multiple keys. It is often used to transmit data between different pages. For example, the request. setAttribute ()/getAttribute () used in jsp is implemented using this set.

 

 

HashMap has a method of entrySet () which is worth mentioning.

public Set<Map.Entry<K,V>> entrySet()

This method returns the attempt to map the set contained in this ing. In general, it is a set containing a pair of <K, V> entities (packed in the set) in this case, the set method can be used to iterate each HashMap object.

 

 

 

 

 

============================================= ===

 

The first time I wrote a blog, I felt a lot of pain. I used Window Live Writer, and I didn't post the code, and I didn't have a picture. I ended up with a few words. I always felt that this editor was not so easy to use. It was not as good as word, it is not as smooth as eating flies. Is it not suitable for me to write blogs? Something so tall.

 


I have learned the basics of java, and I don't need to learn j2se any more.

First, there is no end to learning
Next, it depends on your development direction.
If you are a website, you will learn jsp, servlet
J2SE learning in Enterprises
Learn how to develop mobile games
Isn't the more knowledge the better?
Welcome to the discussion. Materials include QQ

J2se is a common JAVA

With the rapid development of Internet networks, Internet-based enterprise applications require that software platforms be open, distributed, and platform independent. As a result, technologies such as RPC/COM/CORBA have emerged one after another, but these technologies have many shortcomings and limitations in practical application. Their specific protocols are difficult to pass through the firewall, so they are not suitable for application development on the Web. To further develop Web-based applications, Sun ONE (Open Net Environment Development Network Environment) and Microsoft's. NET and other Web Service technical systems have emerged.

The Sun ONE architecture is centered on the Java language, including J2SE/J2EE/J2EE and a series of standards, technologies and protocols. It includes Sun's unique iPlanet Software Series, including popular LDAP directory server software on the market and Forte for Java-a software tool that allows you to write Java in any environment. We can easily obtain and use products including the Java integrated development environment, Java database and middleware (Application Server) Server for free on the Internet, as well as their source code. Sun ONE is closer to or can meet the distributed, development, and platform-independent requirements of smart Web service providers on the Internet.

With the continuous development of Java technology, it is further divided into: J2EE for Enterprise network applications (Java 2 Enterprise Edition), J2SE for general PC applications (Java 2 Standard Edition) and Java 2 Micro Edition for embedded devices and consumer appliances. This article introduces Sun ONE's core Java application, J2SE, J2EE, and j23.

J2EE Technology Application

J2EE is a new concept model launched by Sun, which is more advantageous than the traditional Internet application model.

J2EE Model

The J2EE Application Programming Model (J2EE Blueprints) provides a system model for implementing J2EE-based multi-tier applications and instance suites, simplifying this complex work. It is used by developers to design and optimize components so that developers can divide their development work according to their policies.

The J2EE application programming model requires developers to divide their work into two types: business logic and presentation logic. The rest are automatically processed by system resources and do not need to be encoded for the middle layer pipeline. In this way, developers can spend more time on business logic and presentation logic. For companies that focus on shortening the project cycle, this change is very popular.

J2EE Platform

The J2EE platform is a standard environment for running J2EE applications. It consists of J2EE deployment specifications (a set of standards that must be supported by all J2EE platform products), IETF standard sets, and CORBA standards. The latest J2EE platform also adds the JavaBean Component Model. Developers can use the JavaBean Component Model to customize Java class instances and access Java classes through defined events.

J2EE supports EJB, so developers can execute multi-user transaction functions. When running on a J2EE Server, Enterprise JavaBeans divides the application logic into reusable and scalable code segments. Enterprise JavaBeans are not new features, but by defining standard clients and service APIs, J2EE enhances its capabilities and portability.

EJB runs in a container of the server and provides all typical middle-layer services, such as transaction management, security, remote customer connection, lifecycle management, and database connection buffering. To enable the transaction system to run in the presence of an EJB container, developers only need to define the transaction attribute of Beans in the deployment description file.

J2EE implements its advantages by defining a set of standard structures, such:

1. J2EE Application Programming Model, which is used to develop multi-level, thin-sized customer user programs... the remaining full text>

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.