| Basic knowledge of JAVA-related 1, object-oriented aspects of the characteristics of which 1. Abstract: Abstract is that it has overlooked a theme has nothing to do with the current objectives of those aspects in order to more fully with the current objectives of the attention-related aspects. Abstract does not intend to understand all the issues, but only select one part of the moment do not have some details. Abstract two aspects, first, the process of abstraction, and the other is data abstraction. 2. Succession: Linked inheritance is a kind of hierarchical model, and to allow and encourage the reuse category, it provides a clearly stated common methods. A new type of object can be derived from existing classes, this type of process is known as succession. New class inherits the characteristics of the original category, the new category known as the original type of derived class (subclass), while the original category as a new type of base class (parent class). Derived class can see from its inherited base class methods and instance variables, and categories can be modified or new methods to make them more suitable for particular needs. 3. Packaging: The package is surrounded by the processes and data, and access to data only through defined interfaces. Object-oriented computing began in the basic concept of the real world can be portrayed as a series of full self-government package of objects, these objects through a protected interface to access other objects. 4. Polymorphisms: Polymorphism refers to different types of objects allowed to respond to the same message. Including parametric polymorphism and inclusion polymorphism polymorphism. Polymorphism flexible language, abstract, behavior sharing, code-sharing advantages of good application function to solve the problem of the same name.
2, String is the most basic data types it? Basic data types include byte, int, char, long, float, double, boolean and short. final category is the type of java.lang.String, and therefore can not inherit this class, this class can not be amended. In order to improve the efficiency of space-saving, we should use StringBuffer Class
3, int and Integer What is the difference between Java offers two different types: reference types and primitive types (or built-in type). Int is primitive java data type, Integer is a java package provided for the int type. Java primitive type for each category of the package. The original type of package type booleanBoolean charCharacter byteByte shortShort intInteger longLong floatFloat doubleDouble Reference types and primitive types of behavior is totally different, and they have different semantics. Reference types and primitive types have different characteristics and usage, they include: the size and speed, this type of data structure the type of storage, when the reference type and the type used for the original example of a data type specified in default values. Object reference instance variables of the default value is null, while the original type of the default values instance variables with their type.
4, String and StringBuffer difference JAVA platform provides two classes: String and StringBuffer, which can be stored and operation of the string that contains a number of characters in character data. The String class provides a numerical string can not be changed. The StringBuffer class provides for modification of the string. When you know the character data to change when you can use StringBuffer. Typically, you can use to dynamically StringBuffers character data structure.
5, run-time anomalies and anomalies of the similarities in general? Anomaly that is running that may occur in a state of non-normal, run-time anomaly that is usually a virtual machine operation that may be encountered in the abnormal operation is a common error. java compiler must request a statement that may arise out of non-run-time anomaly, but does not require a statement has not been caught out run-time anomaly.
6, say Servlet life cycle, and tell the difference between Servlet and CGI. Servlet instantiated by the server, the container is running its init method, the request arrived to run the service method, service method of automatically sending a request to run with the corresponding doXXX methods (doGet, doPost) and so on, when the server decided to call a time when examples of the destruction of its destroy method. The difference is that with cgi server process in a servlet, it runs through its multi-threaded service methods, an example can be served on a number of requests, and the examples of the general will not be destroyed, and CGI requests are generated for each new process services after the completion of the destruction, so the efficiency is lower than the servlet.
7, to say ArrayList, Vector, LinkedList and storage performance characteristics ArrayList and Vector are stored using an array of data, the number of array elements is greater than the actual data stored in order to increase and to insert elements, which are indexed by serial number to allow the direct elements, however, to insert the element of the array elements involved in mobile operations, such as memory, so index data fast and slow insert data, Vector methods of the use of synchronized (thread-safe), usually worse performance than the ArrayList, and LinkedList list used to achieve two-way storage, indexed by serial number before the data needs to traverse to or after , but only need to insert the data before and after record of this can be, so insert faster.
8, EJB technology is based on the realization of what? And SessionBean and EntityBean tell the difference, StatefulBean and StatelessBean difference. EJB including the Session Bean, Entity Bean, Message Driven Bean, based on JNDI, RMI, JAT and other technology. SessionBean in J2EE applications are used to complete a number of server-side operations, such as access to the database, call other EJB components. EntityBean application system is used to represent the data used. For the client, SessionBean is a non-persistent object that the achievement of some running on the server business logic. For the client, EntityBean is a persistent object, it represents a memory stored in the persistent object in view of the entity, or an existing enterprise applications to achieve the entity. Session Bean can also be subdivided into Stateful Session Bean and Stateless Session Bean, both the Session Bean can be placed on the system logic of the implementation method, unlike the Stateful Session Bean can record the caller's state, it is often to that a user will have a corresponding entity of the Stateful Session Bean. Stateless Session Bean Components While the logic is, but he did not record the user is responsible for the state, that is to say when a user calls a Stateless Session Bean time, EJB Container will not find a specific entity of Stateless Session Bean to implement this method. In other words, the most likely number of users in the implementation of certain methods of Stateless Session Bean, the Bean will be the same in the implementation of the Instance. From memory point of view, Stateful Session Bean and Stateless Session Bean comparison, Stateful Session Bean consume more J2EE Server memory, however, the advantage of Stateful Session Bean is that he can maintain the status of the user.
9, Collection and the Collections of the difference. Collection is a collection of superior class interfaces, interface inheritance and his main Set and List. Collections is a collection of class categories to help, he provides a wide range of static methods to search a variety of collection, sorting, such as thread-safe operation.
10, & and & & the difference. & Is an operator, said that with the bitwise operator, & & is a logical operator that logic (and).
|
|
Leave a Reply