Learn Java from 0: What are the similarities and differences between runtime exceptions and general exceptions?

Source: Internet
Author: User

Infinite Interconnect starting from 0 learn java-related Fundamentals of Java series, Java Basic training, the difference between String and StringBuffer

1.Java basic learning, starting from 0 to learn the difference between java:string and stringbuffer?

The Java platform provides two classes: string and stringbuffer, which can store and manipulate strings, which are character data that contain multiple Characters. This string class provides a string of values that cannot be changed. The string provided by this StringBuffer class is Modified. You can use StringBuffer when you know that character data is going to Change. typically, you can use Stringbuffers to dynamically construct character Data.

2.Java Basic Learning , starting from 0 Java: what are the similarities and differences between runtime exceptions and general exceptions?

650) this.width=650; "src=" http://p3.pstatp.com/large/11f9000088868c64fd9b "style=" margin:1em auto;padding:0px; border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit; line-height:inherit;vertical-align:baseline; "alt=" 11f9000088868c64fd9b "/>

"learn java from 0" Java basic training, the difference between String and StringBuffer

3.Java Basic Learning , starting with 0 Java: say the Servlet's life cycle and tell the difference between a servlet and a cgi.

When the servlet is instantiated by the server, the container runs its init method, The service method is run when the request arrives, and the service method automatically dispatches the Doxxx method (doget,dopost) corresponding to the request, etc. The Destroy method is called when the server decides to destroy the Instance.

The difference from CGI is that the servlet is in a server process, it runs its service method in a multithreaded manner, one instance can serve multiple requests, and its instances are generally not destroyed, and CGI generates a new process for each request, which is destroyed after the service is Completed. So the efficiency is lower than the Servlet.

4.Java Basic Learning , starting from 0 Java: say arraylist,vector, linkedlist storage performance and features

arraylist and vectors use arrays to store data, which is larger than the actual stored data in order to add and insert elements, both of which allow the element to be indexed directly by ordinal, but the insertion element involves memory operations such as array element movement, so the index data is fast and the data is inserted slowly. Vector because of the use of the Synchronized method (thread-safe), usually performance is worse than arraylist, and LinkedList using a doubly linked list for storage, index data by ordinal need to be forward or backward traversal, but when inserting data only need to record the item before and after items can be , so the insertion speed is faster. Infinite Interconnect starting from 0 to learn java-related Fundamentals of Java series, Java Foundation learn .

5.Java Basic Learning , starting from 0 to learn JAVA:EJB is based on what technology to achieve? and say the difference between Sessionbean and entitybean, Statefulbean and Statelessbean.

EJB includes session bean, Entity bean, Message driven bean, which is implemented based on jndi, RMI, JTA and so On.

Sessionbean is used in the Java EE application to perform some server-side business operations, such as accessing the database and invoking other EJB Components. Entitybean is used to represent the data used in the application System.

For a client, Sessionbean is a Non-persistent object that implements some business logic that runs on the Server.

session Bean can also be subdivided into Stateful session Bean and stateless session bean, both of which can put system logic in the method of execution, the difference is Stateful The session bean can record the status of the caller, so usually a user will have a corresponding entity for the Stateful Session Bean. Although the stateless session Bean is also a logical component, he is not responsible for recording the user state, which means that when the user calls the stateless Session bean, the EJB Container does not look for a specific stateless Ses Sion the Bean's entity to execute this METHOD. In other words, it is likely that several users will be executing the Instance of the same bean when executing the methods of a stateless Session Bean. In terms of memory, the Stateful session bean compared to the stateless session bean, Stateful session Bean consumes more memory from the Java EE Server, but Stateful sessio The advantage of n beans is that he can maintain the User's State.

keywords tags: java training, java basic training, Java basic learning, starting from 0 to learn java,string

650) this.width=650; "src=" http://p3.pstatp.com/large/11960006b61355fb281b "style=" margin:1em auto;padding:0px; border:0px;font-family:inherit;font-size:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit; line-height:inherit;vertical-align:baseline; "alt=" 11960006b61355fb281b "/>


This article from "12315497" blog, declined reprint!

Learn Java from 0: What are the similarities and differences between runtime exceptions and general exceptions?

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.