笔记有关Java的一些问题
来源:互联网 发布:阿里云域名管理地址 编辑:程序博客网 时间:2024/05/22 10:24
Hashtable
is synchronized.Vector
is synchronized.Note that this implementation is not synchronized. If multiple threads access a tree set concurrently, and at least one of the threads modifies the set, it must be synchronized externally. This is typically accomplished by synchronizing on some object that naturally encapsulates the set. If no such object exists, the set should be "wrapped" using the Collections.synchronizedSortedSet
method. This is best done at creation time, to prevent accidental unsynchronized access to the set:
SortedSet s = Collections.synchronizedSortedSet(new TreeSet(...));
LinkedList:
Note that this implementation is not synchronized. If multiple threads access a linked list concurrently, and at least one of the threads modifies the list structurally, it must be synchronized externally. (A structural modification is any operation that adds or deletes one or more elements; merely setting the value of an element is not a structural modification.) This is typically accomplished by synchronizing on some object that naturally encapsulates the list. If no such object exists, the list should be "wrapped" using the Collections.synchronizedList
method. This is best done at creation time, to prevent accidental unsynchronized access to the list:
List list = Collections.synchronizedList(new LinkedList(...));
注:Vector和Hashtable是两个古老的集合类,Vector实现了List接口,Hashtable实现了Map接口,只有这两个(Vector和Hashtable)是同步的,其他都使非同步的。Hashtable不允许null作为key或者value。Vector底层由动态数组实现。
3. JDBC Transaction Isolation Levels
con.setTransactionIsolation(TRANSACTION_READ_UNCOMMITTED);
The higher the transaction isolation level, the more care is taken to avoid conflicts. The Connection interface defines five levels, with the lowest specifying that transactions are not supported at all and the highest specifying that while one transaction is operating on a database, no other transactions may make any changes to the data read by that transaction. TRANSACTION_READ_UNCOMMITTED, used in the previous example, is one level up from the lowest level. Typically, the higher the level of isolation, the slower the application executes (due to increased locking overhead and decreased concurrency between users). The developer must balance the need for performance with the need for data consistency when making a decision about what isolation level to use. Of course, the level that can actually be supported depends on the capabilities of the underlying DBMS.
Subprojects
- Docs
- Test
- Flood
- libapreq
- Modules
- mod_fcgid
- mod_ftp
History
The Apache Software Foundation got its start in 1995 with its first project, the Apache Hypertext Transfer Protocol (HTTP) Server, also known as Apache Web Server. The project evolved from the httpd software developed by the National Center for Super Computing (NCSA), which was the most popular web server on the Internet at the time. The first Apache Web Server was released in December 1995.
The Tomcat server got its start at Sun Microsystems, the creators of the Java programming language, as a server implementing the Java Servlets and JavaServer Pages (JSP) specification. Sun Microsystems donated the code to the Apache Software Foundation in 1999. Apache's first Tomcat server release was version 3.0 in 1999.
Function
Apache Web Server is software that resides on a network-connected computer, accepts requests from web browsers and other clients on remote computers, and responds by sending back the content requested. The content can be static files, such as web pages and images, or the results of executable files, such as PHP and Perl scripts.
Tomcat Server is a specialized web server called a "servlet container." It features a basic web server customized to execute Java servlets and JSP pages.
Benefits
Apache Web Server offers flexibility, both natively and through add-ons called "modules" or simply "mods." It can be configured to handle requests for dynamic content driven by a wide range of languages and technologies, including Perl, Python, PHP, Ruby, ASP and binary executables. Apache can also be configured to use the Tomcat server as a back-end handler for servlets and JSP pages. Other modules for Apache Web Server provide added functionality, such as generating formatted directory views, serving web content from user directories, authentication, SSL, WebDAV and response content compression. The popularity of the Apache Web Server has led to extensive third-party development for the package.
Tomcat, as a stand-alone web server, offers optimization for servlets and JSP pages. Tomcat can be configured to serve dynamic content generated by Common Gateway Interface (CGI), PHP, Ruby and other technologies.
Considerations
Websites serving only static content, servlets and JSP pages often choose to use the Tomcat as the primary web server because it offers enhanced performance over the Apache Web Server. Tomcat can also serve as back-end servlet container for the Apache Web Server. While this configuration can affect overall performance, it provides the additional flexibility that Apache offers for configuring complex, multi-user environments.
Warnings
Results may vary. There is some debate over whether Tomcat Server or Apache Web Server is the faster web server. Server performance is dependent on the configuration of the server software. Start-up options, optimizations, performance tuning, and other settings all affect performance. As a result, performance comparisons don't always illustrate a clear winner. Ultimately, the choice to use one, the other, or a combination of both is dependent not on performance, but on requirements and preference.
5. 如下哪些可以被继承
java.lang.Thread 普通类
Thread类是可以被继承的,一个线程的的一种方式就是继承Thread类
The abstract class Number is the superclass of classes BigDecimal, BigInteger, Byte, Double, Float, Integer, Long, and Short.
Subclasses of Number must provide methods to convert the represented numeric value to byte, double, float, int, long, and short.
- 笔记有关Java的一些问题
- 有关流的一些笔记
- 有关java编辑PDF的一些小问题
- 有关初始化的一些问题
- 有关宏的一些问题
- 有关编码的一些问题
- Activity有关的一些问题
- 有关zipalign的一些问题
- 有关UICollectionviewController的一些问题
- 有关Linux的一些问题
- 有关于java中的一些容器问题
- java中一些有关乱码问题
- java笔记--有关构造函数的小问题
- 有关GCC的一些记录笔记
- 有关AsyncTask的一些随笔笔记
- java笔记 一些和java网络及IO有关的代码
- 有关做PM的一些问题
- 有关VS2005使用的一些基本问题.
- Spring之入门实例
- Spring之配置文件加载方式
- 转; 防止电子眼拍到车牌的秘籍--分享一下
- Android之Parcelable, Parcel
- jQuery 的各种选择器
- 笔记有关Java的一些问题
- VC++中发布MFC程序
- 设计模式4-Observer(观察者模式)
- C#实现的常见排序算法
- 常见的23种设计模式的有趣见解
- OpenCore框架概述(二)
- 重启一下机子就出现电脑下面提示 "windows7内部版本7600此windows副本不是正版"
- Spring之控制反转(IoC)
- 做软件项目经理应该注意的一些品质