| 1, object-oriented features of what has 1. Abstract: Abstract is that it has overlooked a subject has nothing to do with the current goal 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 questions, but only one of the select part of the temporary do not have some of the details. Abstraction has two aspects, first, the process of abstraction, and the other is data abstraction. 2. Succession: Inheritance is a connection type of hierarchical model, and permit and encourage the kind of reuse, it provides a clearly articulated common approach. A new type of object can be derived from existing category, a process known as the type of succession. New class inherits the original categories of identity, a new category known as the original type of derived class (subclass), while the original type is called a new type of base class (parent class). Derived class can see from its inherited base class methods and instance variables and class can modify or add new methods to make them more suitable for the needs. 3. Package: Packages are put together to surround the process and data, access to data only through defined interfaces. Object-oriented computing began in the basic concept, that is the real world can be portrayed as a series of full autonomy, package object, these objects through a protected interface to access other objects. 4. Polymorphisms: Polymorphism refers to permit different types of objects to respond to the same message. Polymorphism, including parametric polymorphism and inclusion polymorphism. Polymorphic language with flexible, abstract, acts of sharing, code-sharing advantages of good application function to solve the problem of the same name. 2, String data types are the most basic right? Basic data types include byte, int, char, long, float, double, boolean and short. java.lang.String type categories are final, and therefore can not inherit the class, should not modify this class. Save space in order to improve efficiency, 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 are java primitive data types, Integer for int are java package provided by category. Java primitive type for each category provides a package. 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, and they include: the size and speed of this type to the type of data structure storage, when the reference type and the original type used as an example of a certain type of data 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 distinction JAVA platform provides two classes: String and StringBuffer, they can be stored and operation of the string, that is, contain multiple characters for character data. The String class provides a numerical string immutable. The StringBuffer class provides string modification. When you know the character data to change when you can use StringBuffer. Typically, you can use to dynamically construct StringBuffers character data. 5, run-time anomalies and anomalies of the similarities in general? Express procedural anomalies that may arise during the operation of the non-normal state, run-time anomaly that is usually a virtual machine operation that may be encountered 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 server was instantiated, the container is running its init method, the request to run its service at arrival Ways, service method of automatically sending a request to run with the corresponding doXXX Ways (doGet, doPost), etc., when the server decided to call a time when examples of destruction destroy its Ways. Cgi difference with servlet in a server process, which threads run through many of its service methods, an example can be served on a number of requests, and its example is generally not destroyed, and CGI requests are generated for each new process service after the completion of the destruction, so efficiency is lower than servlet. 7, say ArrayList, Vector, LinkedList of storage performance and characteristics of ArrayList and Vector are stored using an array of data, the array element number is greater than the actual data stored in order to increase and to insert the element, they permit a direct index of the element, by serial number, but the insertion element to the array elements involved in mobile and other memory operations, so index data fast and slow insert data, Vector methods because of the use of a synchronized (thread-safe), usually worse performance than the ArrayList, and LinkedList implementation using two-way linked list storage, indexed by serial number of data required to conduct prior to or after the traversal , but only need to insert the data before and after the Record of this item can be, so insert faster. 8, EJB technology is based on the implementation 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, such as technology implementation. SessionBean in J2EE applications are used to complete some 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 objects, which achieve some running on the server business logic. For the client, EntityBean is a persistent object, it represents a memory stored in the persistent entities in the target view, or an existing enterprise application implementation entity. Session Bean can also be subdivided into Stateful Session Bean and Stateless Session Bean, both of the Session Bean can be placed on the system logical method of implementation are different Stateful Session Bean can record the caller's state, it is often to Say, a user will have a corresponding entity Stateful Session Bean. Although the Stateless Session Bean is also a logical components, but he did not record the user is responsible for state, that is to say when a user calls a Stateless Session Bean time, EJB Container will not find a specific entity 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 J2EE Server with more memory, however, the advantage of Stateful Session Bean is that he can maintain the user's state. 9, Collection and Collections difference. Collection collections are superior interface, interface inheritance and his principal has Set and List. Collections are collections for a helper class, provide him with a series of static methods of implementation of various collections of search, sorting, such as thread-safe operation. 10, & and & & the difference. & Are bitwise operators, and express bitwise operator, & & is a logical operator, the logic and express (and). 11, HashMap and Hashtable difference. HashMap are lightweight Hashtable implementation (non-thread-safe implementation), they have completed the Map interface, the main difference is that HashMap permit empty (null) key (key), because of the non-thread-safety, efficiency may be higher than Hashtable. HashMap allows null as an entry of the key or value, while Hashtable does not allow. HashMap put contains the Ways Hashtable removed, replaced by containsvalue and containsKey. Since it contains could easily lead to misunderstanding. Dictionary inherited from Hashtable class, and HashMap are Java1.2 introduced a Map interface implementation. The biggest difference is that, Hashtable methods are Synchronize, and HashMap is not, in a number of threads to visit Hashtable having their own methods for its implementation synchronization, while the HashMap must provide external synchronization. Hashtable and HashMap using the hash / rehash algorithm are approximately the same, so performance will not have significant differences. 12, final, finally, finalize the distinction. final statement for the property, methods and types of property that can not be changed, methods of non-coverage category can not be inherited. finally exception handling statements are part of the fabric that is always the implementation. Object categories are finalize a way, in the implementation of the garbage collector will call when the object was the recovery of this method, you can override this method to collect waste from other resources at the time of recovery, for example, turn off documents. 13, sleep () and wait () What is the difference? sleep is the thread type (Thread) method, resulting in this thread to suspend the specified period of time, to the Executive the opportunity to give other threads, but to monitor the status of remains, after that time will automatically resume. Call sleep will not release the object lock. wait are Object class methods, call the wait method on this object cause the thread to give up the object lock, enter the Wait for lock Wait for the object pool, the only issue for this object notify method (or notifyAll) only after the thread locking the object into the pool ready access to the object lock to enter the running state. 14, Overload and Override the distinction. Overloaded methods can change the return value type? Method Overriding and overloading Overloading rewrite Java are different manifestations of polymorphism. Rewrite Overriding parent class are between the polymorphism and subclasses of a performance, heavy-duty Overloading a class are a manifestation of polymorphism. If a subclass defined methods and his father have the same type name and parameters, we say that the method has been rewritten (Overriding). Subclass of the object using this method will call the sub-category definitions, it is concerned, the father of the definition of class as being "shielded" the. If a class defined in a number of methods of the same name, they have different parameters or the number or type has different parameters, is referred to as overloaded methods (Overloading). Overloaded methods can change the type of return value. 15, error and exception What is the difference? express the restoration error is very difficult but not impossible in case of a serious problem. For example, memory spill. Procedures could not be expected to deal with such cases. express exception of a design or implementation problem. In other words, it is said that if the program is running normal, never happened. 16, the similarities and differences between synchronous and asynchronous, under what circumstances to use them separately? Example. If the data will be shared between threads. For example, data is being written by another thread may read or are read the data may have been written by another thread, then the data is shared data must be synchronized access. When the application calls an object takes a long time to implement the methods, procedures and do not want to wait for the return method, it should use the asynchronous programming, in many cases the use of asynchronous channels are often more efficient . 17, abstract class and interface What is the difference? Statement methods exist to achieve it without the class being called abstract class (abstract class), it is used to create an embodiment of certain basic types of behavior, and such statements, but should not in this type of implementation of such situation. Can not create abstract class. However, you can create a variable, its type is an abstract class, and make it point to a specific sub-category of a case in point. Constructor should not have an abstract or abstract static methods. Abstract class subclass the parent class for them all the abstract methods for implementation, otherwise, they are also for the abstract class. Instead, in the sub-class implementation of the method. Know its behavior in other types of class can achieve these methods. Interface (interface) is a variant of abstract class. Interface, all methods are abstract. Multiple inheritance can be through the realization of this interface receive. Interface all methods are abstract, not a single body has the procedure. Interface can only define static final member variables. Interface implementation and sub-class is similar except that the type of implementation should not inherit from the interface definition of behavior. When the category of special interface implementation, it is the definition of (the upcoming procedure body to give) all of this interface method. And, it can achieve the interface of any object method call interface. Have abstract class because it allows the use of interface name as the reference variable type. The usual dynamic binding will take effect. Quote can be converted to the interface type, or conversion from interface type, instanceof operator can be used to determine whether a particular object type implementation of the interface. 18, heap and stack What is the difference between. Stack is a linear collection of add and delete elements of its operation should be completed in the same paragraph. Stack in accordance with the LIFO manner. Heap stack are an integral element 19, forward and redirect the distinction forward the request are the server resources, direct access to the target server address URL, put the URL to read from the response content, and then re-circulated to put the content browser, the browser simply do not know the contents of the server are sent from where, and so It's the address bar or the original address. Service-side redirect is in accordance with the logic of sending a status code, go tell the browser to request the address, the browser will generally request Just now all the parameters re-request, so session, request parameters are available. 20, EJB and JAVA BEAN difference? Java Bean is a reusable component, the Java Bean does not strictly regulated, in theory, any Java type can be a Bean. But normal circumstances, because of Java Bean containers are to be created (such as Tomcat), and so Java Bean should have a constructor without parameters, the other, usually Java Bean also Serializable interface implementation for the implementation of the Persistent Bean. Java Bean in fact equivalent to Microsoft's COM model local process COM components, it is a cross-process should not visit. Enterprise Java Bean equivalent DCOM, or Distributed Component. It is based on Java's Remote Method Invocation (RMI) technology, can be so EJB remote access (inter-process and inter-computer). But the EJB must be deployed in such Webspere, WebLogic such containers, EJB clients never directly access the real EJB components, but rather through its container access. EJB containers are agent EJB components, EJB components created by the container and management. Customers through the container to access the real EJB components. 21, Static Nested Class and Inner Class different. Static Nested Class is a statement as a static (static) internal type, it can not rely on an external instance of a class that was instantiated. Usually, the internal type required in the external category can instantiate instantiated. 22, JSP Dynamic INCLUDE with the distinction between static INCLUDE? INCLUDE with dynamic jsp: include action to achieve it will always be to check the changes contained in the document, suitable for containing dynamic pages, and can take parameters. Static INCLUDE PN code used include implementation, will be contained in the document does not check for changes, applies to contain static pages 23, when using assert. assertion (assertion) in software development is a common way of debugging, a lot of the development of language support such a mechanism. Medium in the implementation, assertion is that in the proceedings a statement, it checks a boolean expressions, a proper procedures must ensure that the value of the boolean expression for the true; If the value is false, explain the procedures already in incorrect state Next, the system will give warning or quit. Generally speaking, assertion assurance procedures for the most basic, the key is correct. assertion checks are usually in the development and testing open. In order to improve performance, after the software release, assertion checking is usually turned off. 24, GC, what are? Why should there be a GC? GC is the meaning of garbage collection (Gabage Collection), memory programmers are easy to deal with any problems that may arise, to forget or mistake will lead to recovery of memory or system instability or even collapse, Java functions can be provided by GC automatic monitoring whether over scope so as to achieve the purpose of automatic recovery of memory, Java language does not provide the release of the display memory have been allocated to the methods of operation. 25, short s1 = 1; s1 = s1 + 1; What is wrong? Short s1 = 1; s1 + = 1; What is wrong? short s1 = 1; s1 = s1 + 1; (s1 +1 computing results are int type, required mandatory conversion type) short s1 = 1; s1 + = 1; (compile correctly) 26, Math.round (11.5) equal how many? Math.round (-11.5) equal how many? Math.round (11.5) == 12 Math.round (-11.5) ==- 11 round Ways and parameters back the closest long - integer, parameter plus 1 / 2 after the order to its floor. 27, String s = new String ( "xyz"); the creation of a number of String Object? Two 28, the design of four threads, each thread of one of the two j increased by 1, and the other two threads on j each decrease of 1. Written procedures. The following inner class implementation procedures for the use of threads, on j does not take time to change the order of questions. public class ThreadTest1 ( private int j; public static void main (String args []) ( ThreadTest1 tt = new ThreadTest1 (); Inc inc = tt.new Inc (); Dec dec = tt.new Dec (); for (int i = 0; i <2; i + +) ( Thread t = new Thread (inc); t.start (); t = new Thread (dec); t.start (); ) ) private synchronized void inc () ( j + +; System.out.println (Thread.currentThread (). GetName ()+"- inc: "+ j); ) private synchronized void dec () ( j -; System.out.println (Thread.currentThread (). GetName ()+"- dec: "+ j); ) class Inc implements Runnable ( public void run () ( for (int i = 0; i <100; i + +) ( inc (); ) ) ) class Dec implements Runnable ( public void run () ( for (int i = 0; i <100; i + +) ( dec (); ) ) ) ) 29, Java has no goto? reserved words in java, there is no use in java. 30, are used to start a thread run () or start ()?. Start a thread are calling start () method, so that the thread represented by a virtual processor can run at a state, which means that it can by the JVM scheduling and implementation. This does not mean that the thread will run immediately. run () method can generate exit signs must be to stop a thread. 31, EJB, including (SessionBean, EntityBean) to tell me their life cycle, and how to manage the affairs? SessionBean: Stateless Session Bean's life cycle are determined by the container when the client sent a request to create a Bean instances when, EJB containers do not have to create a new Bean instance for the client call, but with a random current Some examples provided to the client machine. When the first client machine to invoke a Stateful Session Bean, the container must immediately on the server to create a new instance of the Bean, and relevance to the client, the client machine after the Stateful Session Bean calls the methods assigned to the container will call this Client Bean associated examples. EntityBean: Entity Beans can survive a relatively long time, and state are continuing. As long as the data in the database exist, Entity beans have survived. Rather than in accordance with the application process or the Service. Even the collapse of the EJB container, Entity beans are also survival. Entity Beans Life Cycle Beans can be container or self-management. EJB technology management practices through the following: Object Management Group (OMG) object Practice Services (OTS), Sun Microsystems of the Transaction Service (JTS), Java Transaction API (JTA), Development Group (X / Open) the XA interface. 32, application servers have those? BEA WebLogic Server, IBM WebSphere Application Server, Oracle9i Application Server, jBoss, Tomcat 33, give me one you most often see runtime exception. ArithmeticException, ArrayStoreException, BufferOverflowException, BufferUnderflowException, CannotRedoException, CannotUndoException, ClassCastException, CMMException, ConcurrentModificationException, DOMException, EmptyStackException, IllegalArgumentException, IllegalMonitorStateException, IllegalPathStateException, IllegalStateException, ImagingOpException, IndexOutOfBoundsException, MissingResourceException, NegativeArraySizeException, NoSuchElementException, NullPointerException, ProfileDataException, ProviderException, RasterFormatException, SecurityException, SystemException, UndeclaredThrowableException, UnmodifiableSetException, UnsupportedOperationException 34, the interface interface inheritable? Abstract class can achieve (implements) interface? Abstract class is inheritable entity class (concrete class)? Interface can be inherited interface. Abstract class can achieve (implements) interface, abstract class is inheritable entity class, but only entity class must have a specific constructor. 35, List, Set, Map is inherited from the Collection interface? List, Set Yes, Map is not 36, out of the job data connection pooling mechanism? J2EE server startup will set up a certain number of pool connections, and has been maintained at not less than the number of connection pool. Necessary to connect the client program, the pool of drivers will return an unused pool table and remember to connect to is busy. If the current connection is not idle, the driver on the new pool a certain number of connections, the number of new connections have decided to configuration parameters. When using the pool to connect call is completed, the driver pool table entry for this connection is idle, other calls can use this connection. 37, abstract of the method can simultaneously are static, it also is a native, it may at the same time are synchronized? Can not 38, the array has no length () this method? String has no length () this method? Array there is no length () this method has the property length. Has String has length () this method. 39, Set's elements are not repeated, then the method used to distinguish whether or not to repeat it? Are using == or equals ()? What is the difference between them? Set where the elements are not repeated, then the use of iterator () method to distinguish whether or not to repeat. equals () are the two Set whether the same interpretation. equals () and == means to determine whether the reference values that point to the same Object equals () has been covered in class in order when the two are separated from the content and the type of object matching, then return true value. 40, whether the constructor Constructor can be override? Constructor constructor can not be inherited, so should not rewrite Overriding, but can be overloaded Overloading. 41, whether the String Class can be inherited? String category final category are therefore not inherited. 42, swtich whether role in byte on whether the role of long on whether the role of the String? switch (expr1) Medium, expr1 is an integer expression. Therefore passed to the switch and case statement are the parameters should be int, short, char or byte. long, string can not act on the swtich. 43, try () there is a return statement, then immediately after the try in the finally () where the code will be executed, when executed, before or after in return? Will be implemented, in return, former executive. 44, program title: The most efficient way to calculate the equal number of 8 multiplied by 2? 2 <<3 45, two targets of the same value (x.equals (y) == true), but may have a different hash code, this sentence right? Wrong, have the same hash code. 46, when an object as parameter to a method, this method can change the attributes of this object, and return the result of the changes, then in the end here are passed by value or reference? Are passed by value. Java programming language, only the value of transmission parameters. When an object instance as a parameter is passed to the method when the value of the parameter is the object. The contents of the object can call methods were changed, but object references are Forever will not change. 47, when a thread entering a synchronized method of an object, the other threads can access objects other methods? Can not, an object of a synchronized method can only be visited by a thread. 48, program title: Writing out a Singleton. Singleton pattern is to ensure a major role in the Java application, a class there is only one instance of Class existence. Singleton pattern in general usually have several in various forms: The first is: the definition of a class, its constructor is private, and it has a static type of the private variable initialization in the class instance, then through a public access to the getInstance method of quoting it, and then Call one of the methods. public class Singleton ( private Singleton () () / / In their own internal definition of an instance, is not it very strange? / / Note This is private only internal calls private static Singleton instance = new Singleton (); / / Here for external access a static method of this class, you can directly access the public static Singleton getInstance () ( return instance; ) ) Second form: public class Singleton ( private static Singleton instance = null; public static synchronized Singleton getInstance () ( / / This method is an improvement over the above, do not be generated every time the object is only the first / / used to generate examples of efficiency! if (instance == null) instance = new Singleton (); return instance;) ) Other forms: The definition of a class, its constructor is private and all methods of static. Is generally believed that the first form to a more secure more 49, Java interface and C + + virtual class the similarities and differences. Because Java does not support multiple inheritance, which may have a certain category or object to be used separately or in a few objects inside the method or property, the existing single inheritance mechanism should not meet the requirements. Compared with the inheritance, interfaces have a higher flexibility, because there is no interface implementation code. When a class implements the interface after the implementation of such interfaces to which all of the methods and property, and property interface inside are in the default state the following public static, default, all methods are public. A class can achieve a number of interfaces. 50, Java exception handling mechanism in a simple principle and applications. When the JAVA program in violation of the semantic JAVA rules, JAVA virtual machine errors will be expressed as an exception. Violation of semantic rules include two kinds of situation. A JAVA class libraries are built-in semantic checks. For example, cross-border array subscript will trigger IndexOutOfBoundsException; access null object will trigger NullPointerException. In other cases, JAVA programmers permit expansion of this semantic checking, programmers can create their own unusual and freely choose when to use the keyword throw an exception is raised. All exceptions are subclasses of java.lang.Thowable. 51, the advantages of recycling garbage and principles. And to consider two kinds of recovery mechanisms. Java language in a prominent feature of this approach is the introduction of garbage collection mechanism to enable c + + programmers the most headache memory management problem solved, it allows Java programmers to write programs in a time when no longer need to consider memory management. Because there is a garbage collection mechanism, Java objects no longer have "scope" concept, only the object reference only "scope." Recycling garbage can effectively prevent the memory leak, an effective use of available memory. Garbage collector is usually as a separate low-level thread running, unpredictable circumstances of the death of memory heap has been a long time or do not use objects clearly and recovery, the programmer should not call the real-time garbage collector for an object or all objects garbage collection. Recovery mechanisms have a copy on behalf of garbage recycling and garbage collection tags, incremental garbage collection. 52, please say you know the method of thread synchronization. wait (): make a thread in a wait state, and the release of the object held by the lock. sleep (): make a thread that is running in a sleep state, is a static method, call this method to capture abnormal InterruptedException. notify (): wake up a thread in a wait state, noted that this method is called when, and should not wake up the exact state of a thread to wait, but by the JVM to determine which thread to wake up, and not by priority class. Allnotity (): wake-up call to all Department of the thread into the wait state, wake-up call to all the attention is not an object of thread lock, but allow them to compete. 53, you know what are the collections? Main method? The most commonly used collections are List and Map. List the specific implementation, including ArrayList and Vector, they are a list of variable size, more suitable to build, store and operate any type of object elements in the list. List applicable to the visit by the numerical index of the case element. Map provides a more generic storage element method. Map collection class used to store elements on (known as the "key" and "value"), one of each key is mapped to a value. 54, describe the JVM to load the principle mechanism for class file? JVM in the class are loaded by the ClassLoader and its subclasses to the implementation, Java ClassLoader is an important component of Java run-time system. It is responsible in the run-time search and the types of documents into categories. 55, char-type variable can store a Chinese characters? Why? Definition can be a Chinese, because the java in a unicode encoding, accounting for a 16 byte char, so the Chinese are not putting a question of 56, multi-threaded implementation has several methods, what are? Synchronization There are several methods of implementation are what? There are two multi-threaded implementation methods are inherited separately Thread Class and Runnable interface achieve realize synchronization has two aspects, respectively, are synchronized, wait and notify 57, JSP's built-in objects and methods. request that the HttpServletRequest object. It contains the browser requests the relevant information and provide a few for access to cookie, header, and session data useful. response express HttpServletResponse object, and provides several settings for the browser's response back to the methods (such as cookies, header information, etc.) out object is an instance of javax.jsp.JspWriter and offers several ways for you to return to the browser output. javax.servlet.jsp.PageContext express a pageContext object. It is used to facilitate access to a diverse range of name space, servlet-related objects API, and packaging of the generic servlet-related functions. express a session object javax.servlet.http.HttpSession request. Session state can store user information applicaton express a javax.servle.ServletContext object. This will help search on the servlet engine and servlet environment information javax.servlet.ServletConfig express a config object. The object used to access the servlet instance initialization parameters. express page from the page generated by a servlet instance 58, the basic concept of threads, thread the basic state and the state of the relationship between the thread refers to the process of implementation procedures, be able to implement a program code implementation units, each of the programs have at least one thread, that is, procedures itself. Java has four kinds of threads in the state are: running, ready to hang, The End. 59, JSP commonly used commands isErrorPage (whether or not to use Exception object), isELIgnored (whether neglect Expressions) 60, under what circumstances to call doGet () and doPost ()? Jsp page form tag in order to get the property when the method call doGet (), for the post when the call doPost (). 61, servlet life cycle web container load servlet, the beginning of the life cycle. By calling the servlet's init () method of servlet initialization. By calling the service () methods of implementation, upon request, call the different methods do ***() different. The End Services, web container servlet calls the destroy () method. 62, how the reality of the single-threaded model servlet 63, page transmission method between the object request, session, application, cookie, etc. 64, JSP and Servlet which have the same point and the different points of contact between them are what? JSP is an extension of Servlet technology, in essence, a simple Servlet are way more emphasis on the application of the appearance of expression. After the JSP compiler is "-type servlet". Servlet and JSP The main difference is, Servlet's application logic in the Java file, and entirely from the express layer separated from the HTML-ri. While JSP is Java and HTML can be combined into one extension. Jsp document. JSP focuses on the view, Servlet mainly used in control logic. 65, four kinds of conversation tracking technology conversation scope ServletsJSP page description are representative of any page with a page-related objects and property. Page compiled by a Java servlet good category (which may include with any instructions, but did not include action) express. This includes both servlet also be compiled into a servlet, including the JSP page request with the Web are on behalf of the client issued a request-related objects and property. A request is likely to span multiple pages, involves a number of Web components (because of forward movement instructions and include the relationship between) session are representatives and are used in a Web client machine, a user experience related to objects and property. A Web session can and often across multiple client requests application are on behalf of the entire Web application-related objects and property. This is essentially across the entire Web applications, including multiple pages, requests and conversations of a global scope 66, Request object's main method: setAttribute (String name, Object): Set the name of the request for the name of the parameter values getAttribute (String name): return name specified by the property value getAttributeNames (): return request object property names of all collections, the result is an enumeration of instances getCookies (): return all client Cookie object, the result is an array of Cookie getCharacterEncoding (): return the request character encoding getContentLength (): return the length of the request of the Body getHeader (String name): to obtain HTTP protocol definition file header information getHeaders (String name): Return the specified request Header names of all the values, the result is an enumeration of instances getHeaderNames (): return request Header name so, the result is an enumeration of instances getInputStream (): return the request input stream, the request for access to the data in the getMethod (): access to the client to transmit data to the server-side method getParameter (String name): access to the client send to server-side has the name specified in parameter values getParameterNames (): access to the client send to server-side the names of all the parameters, the result is an enumeration of instances getParameterValues (String name): access to the specified parameter name has all the values getProtocol (): access to the client to transmit data to the server-side protocol is based on the name of getQueryString (): access to query string getRequestURI (): request string to obtain the client address getRemoteAddr (): access to client's IP address getRemoteHost (): access to the client's name getSession ([Boolean create]): return and request the relevant Session getServerName (): access to the server's name getServletPath (): access to the client the requested script file path getServerPort (): access to server's port number removeAttribute (String name): delete the request of a property 67, J2EE is the technology or platform or framework? 79, customer service EJB client calls the object a few basic steps to set up factories and JNDI Service System JNDI Service Address property, Home search interface, from the Home Interface Remote Call Create method to create interfaces, through the Remote interface to call methods of its business. 80, how to specify the size of memory weblogic? Weblogic startup script (located where the corresponding Domian server directory startServerName), increased set MEM_ARGS =- Xms32m-Xmx200m, can adjust the minimum memory for the 32M, the largest 200M 81, how to configure the weblogic's hot start mode (development mode) and product release mode? In the management console to modify the corresponding server's startup mode for the development of one model or product. Services start-up or modify documents or document commenv increase set PRODUCTION_MODE = true. 82, How to start, is not required to enter a user name and password? Service startup files modified to increase the WLS_USER and WLS_PW item. Boot.properties documents can also add encrypted user name and password. 83, in Taichung weblogic management of an application domain (or are a web site, Domain) to JMS and ejb or connection pool related configuration information, the actual document stored in what? Save this Domain in the config.xml file, which is the core of the server configuration file. 84, to talk about weblogic a Domain default directory structure? Such as to a simple directory helloWorld.jsp Add to Ho, the likelihood of the browser you can enter the http:// host: port number / / helloword . jsp will be able to see the results of the run? also used such as this one of a JavaBean wrote it myself how to do? Domain Directory directory server applications, the directory will be applied on this directory as the application will be able to visit, in the case of Web applications, application directory directory necessary to meet the requirements of Web applications, jsp files can be placed directly on the application directory, Javabean required on the application directory The WEB-INF directory of classes directory, set the default application server will be able to achieve in your browser without the application of input. 85, published in the weblogic entail ejb configuration file to which different types of EJB involves a different configuration file, are involved in the configuration file including the ejb-jar.xml, weblogic-ejb-jar.xmlCMP Entity Bean are generally required weblogic - cmp-rdbms-jar.xml 86, How to configure weblogic in ssl with client authentication configuration or to talk about j2ee (standard) for ssl configurations use the default installation DemoTrust.jks KeyStore implementation DemoIdentity.jks and SSL, need to configure the server using the Enable SSL, configure their port, in the product model required to obtain from the CA private key and digital certificate, create identity and trust keystore, loading access keys and digital certificates. SSL can be configured for this connection is a one-way or two-way street. 87, How can I see in the weblogic has released EJB? Can use the Management Console, in its Deployment can view all of the EJB has been published 88, CORBA What? What is the purpose? CORBA standards are CORBA (Common Object Request Broker Architecture), by the Object Management Group (Object Management Group, abbreviated as OMG) standardization. Its composition is the Interface Definition Language (IDL), language bindings (binding: Binding also translated), and permit inter-application interoperability agreement. Its purpose: use different programming languages to write in a different process to run different operating systems development. 89, like you are familiar with or heard of the j2ee in some commonly-used mode? And design patterns for some of the views of Session Facade Pattern: use SessionBean visit EntityBean Message Facade Pattern: Asynchronous calls EJB Command Pattern: Use Command JavaBeans replace SessionBean, lightweight implementation visit Data Transfer Object Factory: through the DTO Factory provides features to simplify data EntityBean Generic Attribute Access: through AttibuteAccess interface provides features to simplify data EntityBean Business Interface: through remote (local) interface and achieve the same category Bean Interface Specification EJB business logic consistency of the design of mixed architecture will have a direct impact on system performance, scalability, maintainability, component reusability and development efficiency. The more complex projects, project teams can more huge the more the importance of good design. 90, to talk about development news in the weblogic Medium Bean when persistent and non-persisten difference persistent forms of MDB can guarantee the reliability of messaging, that is, if the EJB container and JMS server problems will still be news in this MDB sent when available, and non-persistent way the news will be discarded. 91, Servlet implementation methods which generally achieve? public void init (ServletConfig config) public ServletConfig getServletConfig () public String getServletInfo () public void service (ServletRequest request, ServletResponse response) public void destroy () 92, j2ee design patterns commonly used? Note the factory model. Java in 23 kinds of design patterns: Factory (factory mode), Builder (construction mode), Factory Method (Factory Method Pattern), Prototype (original model mode), Singleton (Example single mode), Facade (window mode), Adapter (Adapter mode), Bridge (bridge mode), Composite (synthesis mode), Decorator (decorative patterns), Flyweight (Flyweight pattern), Proxy (proxy mode), Command (command mode), Interpreter (interpreter mode), Visitor (visitor mode), Iterator (Iterator mode), Mediator (mediator model), Memento (memorandum mode), Observer (Observer Pattern), State (state model), Strategy (Strategy Pattern), Template Method (Template Method Pattern), Chain Of Responsibleity (chain of responsibility model) Factory Pattern: factory pattern is a frequently used model, according to the class factory pattern implementation can be generated according to data provided by a group of a certain type of class examples of this group usually have a common type of abstract parent class and achieve the same methods, but these methods for different data for a different operation. First need to define a base class, the class sub-class, through different means of implementation of the base class method. Then necessary to define a factory class, factory class can be generated in accordance with the conditions of different sub-class examples. When to be examples of sub-class, the developer can call the base class method without having to consider the return in the end are examples of what sub-category. 93, EJB implementation need to direct its business interface or Home interfaces you, please briefly reasons. Remote interface and Home interfaces do not need a direct implementation, and their implementation code are generated by the server, run the corresponding type of implementation as an example of the corresponding interface type being used. 94, which has several ways to sort? Please list. JAVA implementation using a quick sort. Sort by: Insertion Sort (Direct Insertion Sort, Hill order), exchange sort (bubble sort, quick sort), select sort order (direct selection sort, heap sort), merge sort and distribution sort (me sort, Radix Sort ) Express sort of pseudo-code. / / Use the quick sort method for a [0: n-1] sorted from a [0: n-1] in a select element as a middle, the fulcrum element to put the remaining elements divided into two left and right, make left elements are less than or equal to the fulcrum, and the right elements are greater than or equal to the fulcrum of the use of recursive quick sort method of sorting left recursive use of quick sort method to sort the results right to left + middle + right 95, requested the following commonly used in J2EE terminology to explain (or brief description) web containers: give at one of the application components (JSP, SERVLET) to provide an environment in which the JSP, SERVLET direct more containers in the environment variable interface interaction, other systems do not have to concern about the problem. Main WEB server has to achieve. For example: TOMCAT, WEBLOGIC, WEBSPHERE, etc.. The containers provided by strict compliance with the J2EE specification interface in the standard WEB APPLICATION. We comply with the above criteria put the WEB server on the WEB called J2EE containers. EJB containers: Enterprise java bean container. More characteristics of industries. Available to him to run one of the components in a variety of management functions EJB. As long as the specifications meet the J2EE Add EJB to the container, the container will be immediately carried out an efficient management. And can be ready-made interface to obtain system level services. Such as mail services, transaction management. JNDI: (Java Naming & Directory Interface) JAVA naming directory services. Mainly provides the function is: to provide a directory system that allows other applications around the top left, in its own index, to meet the fast search and location functions of distributed applications. JMS: (Java Message Service) JAVA Message Service. Achieve all the major communication between applications. Including point-to-point and broadcasting. JTA: (Java Transaction API) JAVA Affairs Service. Provide a variety of Distributed Transaction Service. Simply call the application's interface can be provided. JAF: (Java Action FrameWork) JAVA security authentication framework. Provide some security control framework. Let developers through a variety of deployment and custom implementation of their personalized safety control strategy. RMI / IIOP: (Remote Method Invocation / internet protocol Object Request Broker) that they are mainly used for long-distance calls through the Service. For example, the remote has a computer running a program, which provides stock analysis services, we can achieve on their local computer called directly. Of course, this is certain to be adopted in order to standardize heterogeneous systems to communicate. RMI is unique JAVA. 96, JAVA language how to deal with anomalies, keywords: throws, throw, try, catch, finally what is the point on behalf of? In the try block can be thrown it? Java through the object-oriented approach to exception handling, put a variety of abnormalities to classify, and provide a good interface. In Java, each anomaly is an object, it is the Throwable or other sub-class examples. When a method after abnormal throw an exception object, the object contains unusual information, call this object the method can capture and deal with this anomaly. Java's exception handling through the five words to achieve the: try, catch, throw, throws and finally. Under normal circumstances is try to implement a section of the procedure, if there is abnormal, the system will be thrown out (throws) an exception, this time you can, through its type to capture (catch) it, or the last (finally) by default processor to deal with. Try to specify the use of a prevention of all "abnormal" procedures. Try the procedure followed in behind, should include a catch clause to specify that you want to capture the "abnormal" type. throw statement to explicitly throw an "abnormal." throws used to indicate a member function may be dished out by a variety of "abnormal." Finally a section of code to ensure that no matter what "abnormal" has been the implementation of a section of code. Members in a function call outside the try to write a statement, in this member function to write another try statement within the protection of other code. Whenever there is a try statement, the "abnormal" on the stack on the framework above, until all have completed the try statement. If the next level, try some kind of statement does not "abnormal" to carry out treatment, the stack will be started until the deal has encountered this kind of "abnormal" try statement. 97, a ". Java" source file can include a number of categories (not the internal type)? What are the limitations? 可以. Must be only one class name with the same file name. 98, MVC are those of the various parts of technology to achieve? How to achieve? MVC is the Model-View-Controller's shorthand. "Model" represents the application business logic (through the JavaBean, EJB component implementation), "View" is the application of the express Noodles (generated by the JSP page), "Controller" is to provide the applications deal with process control (usually a Servlet ), through the application of this design model logic, process and display logic implementation is divided into different components. These components can interact and reuse. 99, java There are several ways in the implementation of a thread? What keywords modified synchronization methods? Stop () and suspend () method did not recommend the use of? There are two implementation methods are inherited separately Thread Class and Runnable interface implementation modified to use synchronized keyword against the use of synchronization method stop (), because it is unsafe. It will disarm all access by the thread lock, and if the object in an inconsistent state, then the other threads in the kind of state inspection and modify them. Results difficult to detect the real problem. suspend () method prone to deadlock. Calling suspend () when the target thread will be stopped, but I still hold in this lock before. At this point, any other threads can not access locked resources, unless they are "hang" the thread to resume running. To any thread, if they want to resume the target thread, at the same time, a lock attempt to use any resources, it will cause a deadlock. Therefore should not use suspend (), but should be in its own Thread class into a sign that the threads should be hung or Events. If the signs pointed out that the thread should suspend, then use wait () Wait for life to enter a state. If the signs pointed out that the thread should be restored, then a notify () to restart the thread. 100, java Medium There are several types of flow? JDK for each type of flow provided for the succession of abstract class, please state what type they are? Byte streams, character streams. Byte-stream succession in InputStream OutputStream, character stream in succession InputStreamReader OutputStreamWriter. In the java.io package there are many other streams, mainly in order to improve performance and ease of use. 101, java memory leak will exist you, please provide a brief description. Will. Such as: int i, i2; return (i-i2); / / when i was a big enough positive number, i2 for a sufficiently large negative. The results would cause overflow, resulting in an error. 102, java implementation of multi-state mechanism is all about? Method Overriding and overloading Overloading rewrite Java are different manifestations of polymorphism. Rewrite Overriding parent class are between the polymorphism and subclasses of a performance, heavy-duty Overloading a class are a manifestation of polymorphism. 103, garbage collector, what are the basic principles? Garbage collector can be immediately recovered memory it? Is there any way to inform the virtual machine garbage collection? For the GC, when programmers to create objects, GC began monitoring this object's address, size and usage. Usually, GC has to map the use of recording and management of heap (heap) of all objects. This way to determine which objects are "accessible" and which objects are "not accessible." When the GC to identify the object as "not up to" when, GC has the responsibility to the recovery of these memory space.可以. Programmers can manually perform a System.gc (), notify the GC to run, but the Java language specification does not guarantee that GC will be the implementation. 104, static variables and instance variables of the difference? static i = 10; / / constants class A a; ai = 10; / / variable 105, what is java serialization, how to achieve java serialization? Serialization is a stream object used to deal with the mechanism, the so-called object flow object that is streaming the content. Convection can be carried out after the object to read and write operation can also be streaming the object after transmission in the network. Sequence is in order to resolve the object in the stream read and write operation, triggered by questions. Sequence of implementation: will need to be serialized class implementation Serializable interface that does not achieve the necessary methods, implements Serializable only in order to mark the object is serialized, and then use an output stream (such as: FileOutputStream) to construct a ObjectOutputStream (object stream) object, then use the ObjectOutputStream object writeObject (Object obj) method can be the parameters for the object obj to write (that is, to preserve its state), to restore, then the input stream. 106, whether from a static method of an internal issue of non-static method call? Can not, if the object contains one of the method (); can not guarantee that the object is initialized. 107, Writing clone () method, usually line of code, what? Clone has a default behavior, super.clone (); he is responsible for producing the correct size of the space-by-bit copy. 108, in JAVA, how to get out of their present multiple nested loops? Using break; return method. 109, List, Map, Set of three interfaces, access element, what the characteristics of each? List specific order to the holder element can have duplicate elements. Set can not have duplicate elements, the internal sort. Map Save key-value value, value may be multi-valued. 110, J2EE are what? J2EE is a Sun company's proposed multi-layer (multi-diered), distributed (distributed), based on component (component-base) of the enterprise-level application model (enterpriese application model). In such an application system, in accordance with the function divided into different components, these components can be in different computers, and at the corresponding level (tier) Medium. Including their level of customer layer (clietn tier) components, web layer and components, Business layer and components, enterprise information system (EIS) layer. 111, UML modeling language aspects of the standard UML. Use case diagram, a static map (including class diagram, object diagram and package diagram), behavioral maps, interactive map (sequence diagram, and cooperation plans), implementation plans. 112, to say some commonly used categories, package, interface, please cite the five commonly used categories: BufferedReader BufferedWriter FileReader FileWirter String Integer Commonly used packages: java.lang java.awt java.io java.util java.sql Commonly used interface: Remote List Map Document NodeList 113, the development of all those who use design patterns? With what occasions? Each model are described in a U.S. environment, continuing problems, and then describes the solution of the problem's core. In this way, many times you can use those existing solutions, the need to repeat the same job. The main use of the MVC Design Pattern. Used to develop JSP / Servlet or J2EE-related applications. Simple factory pattern and so on. 114, jsp What action? Separately what role? JSP total of six kinds of basic actions following jsp: include: in the page when the requested the introduction of a document. jsp: useBean: find or instantiate a JavaBean. jsp: setProperty: Setting the JavaBean property. jsp: getProperty: the output of a JavaBean property. jsp: forward: put the request to a new page. jsp: plugin: In accordance with the type of browser plug-ins for the Java generated OBJECT or EMBED tag. 115, Anonymous Inner Class (anonymous inner class) it can extends (inheritance) to other categories, it can implements (implementation) interface (interface)? Other types can be inherited or completion of other interfaces, commonly used in swing programming this way. 116, application server and the difference between WEB SERVER? Application Server: Weblogic, Tomcat, Jboss WEB SERVER: IIS, Apache 117, BS and CS linkages with distinction. C / S is a Client / Server abbreviation. Servers are typically high-performance PC, workstation or minicomputer, and the use of large-scale database system, such as Oracle, Sybase, Informix or SQL Server. Client need to install special client software. B / S are Brower / Server acronym, as long as the client machine to install a browser (Browser), such as Netscape Navigator or Internet Explorer, the server is installed Oracle, Sybase, Informix or SQL Server and other databases. In this structure, the user interface entirely through the WWW browser implementation, some business logic in the front-end implementation, but the main business logic in server-side implementation. Browser through the Web Server with the database for data exchange. C / S and B / S distinction: 1. Hardware environment is different: C / S in general set up a dedicated network, the small range of network environments, LAN between the servers through dedicated connections and data exchange services. B / S set up in the wide area network above does not take a specialized network hardware environment, were in line with the telephone line, leased equipment. Information to manage. Has more than C / S range of adaptability, the general as long as there is operating system and browser on the line 2. Safety requirements of the different C / S for the general user base is relatively fixed, the information capacity of a strong safety control. Generally highly classified information system uses C / S structure suitable. By B / S part of publicly released information. B / S set up in the wide area network based on weaker safety control may be unknown for users. 3. Procedural framework for the different C / S program can pay more attention to flow, you can check on the multi-level permissions on the system operating speed can be considered less. B / S on the security and access speed of the multiple considerations, set up in the need for more optimized basis. Than the C / S have higher requirements for B / S structure of the program are the development trend of architecture, from the MS's. Net Series The BizTalk 2000 Exchange 2000 and so on, comprehensive network of support structures of the system components. SUN and IBM pushed the JavaBean component technology, so that B / S more sophisticated. 4. Software reuse in different C / S can be considered holistic inevitable, as reusable components in the B / S under the requirements of good reuse of components. B / S on the multiple structure, demands a relatively independent functional components. Be able to reuse relatively good. On the table can be purchased to re-use, rather than make a stone table on the wall 5. System maintenance of different C / S because of the overall process, must be inspected, as well as deal with problems in system upgrades. Upgraded difficult. May be to do a completely new system B / S Component composition, aspects of the replacement of individual components, systems implementation a seamless upgrade. system maintenance to minimize overhead. users download from the Internet to install on their own can achieve the upgrade. 6. Questions deal with different C / S program can deal with customers face fixed, and in the same region, the safety requirements of high demand associated with the operating system. The system should be the same B / S set up in wide-area network, for different user groups, distributed regions, which are C / S can not be a position to do so. relationship with the operating system platform, the smallest. 7. User interfaces of different C / S are set up many of the Window platform, the performance of methods is limited, for programmers generally require a higher B / S set up in the browser, there are more rich and vivid expressions communicate with the user. And most of the difficulty of reduce, reduce development costs. 8. Information flow in different C / S program in general is a typical centralized mechanical treatment, interactive relatively low B / S may change the flow of information, BB BC BG and other information, the flow changes, like trading center. 118, LINUX under the thread, GDI-type explanation. LINUX is based on the core implementation of the lightweight process "one-on-one" thread model, a thread corresponding to a core entity lightweight process, and thread management between the outer function in the nuclear implementation library. GDI graphics device type for library programming interface. 119, STRUTS application (such as STRUTS architecture) Struts is Java Servlet / JavaServer Pages technology, the development of Web applications, open-source framework. Able to issue the use of Struts-based MVC (Model-View-Controller) design pattern application framework. Struts has the following main functions: 1. Contains a controller servlet, the user's request can be sent to the appropriate Action object. II. JSP freely tag libraries, and associated controller servlet to provide support to help developers create interactive form applications. Three. To provide a series of useful objects: XML processing, through the Java reflection APIs automatically handle JavaBeans property, internationalization of prompts and messages. 120, Jdo what? JDO is a Java Object Persistence of new norms for the java data object referred to, but also a data warehouse for access to certain objects in a standardized API. JDO provides transparent object storage, and therefore developers, the stored data objects do not need extra code (such as the use of JDBC API). These tedious routine work has been transferred to the JDO Product providers who allow developers out in order to focus time and energy in the business logic. In addition, JDO is flexible because it can run on the bottom of any data. JDBC is for relational databases (RDBMS) JDO more common to provide any data to the bottom of the storage function, such as relational databases, files, XML and object-oriented database (ODBMS) and so on, making applications more portable. 121, internal category contains categories quote him a member of it? Nothing has restrictions? An internal class object can access to create its object the content of external category 122, WEB SERVICE Glossary. Introduction JSWDL development kit. JAXP, JAXM explanation. SOAP, UDDI, WSDL explained. Web ServiceWeb Service is a Web-based, distributed modular components, which perform specific tasks, comply with specific technical specifications, these specifications enable Web Service can be compatible with other components interoperability. JAXP (Java API for XML Parsing) is defined in Java using DOM, SAX, XSLT generic interface. This in your program as long as you use the common interface, when you need to change the specific implementation does not need to modify the time code. JAXM (Java API for XML Messaging) is to provide access to SOAP communication methods and transmission mechanism of API. WSDL is an XML format, used to describe network services for a group of endpoints, these endpoints contain information or document-oriented process-oriented information to operate the news. This format first operation and messages described in the abstract, and then bound to a specific network protocol and message format to define the endpoint. Related to the specific endpoints that portfolio to become an abstract endpoint (service). SOAP or Simple Object Access Protocol (Simple Object Access Protocol), which are used to exchange XML encoded information lightweight protocol. The purpose of UDDI is the standard set up for e-commerce; UDDI is a Web-based, distributed for the Web Service provided information registry standards implementation, but also set so that enterprises can provide their own Web Service Register in order to enable other businesses to find access to the standard implementation of the protocol. |
Smilar Posts of Great collection of java interview topics
-
Hibernate primary key strategy-sequence
Today, the use of hibernate in the company encountered a troublesome problem, the use of hibernate when the primary key generation strategy set sequence, but always reported in the implementation coul ...
-
Hibernate pessimistic locking mechanism for locking and optimistic locking
hibernate lock mechanism 1. Pessimistic lock It refers to the modification of data by outsiders hold a conservative attitude. The assumption that at any time access to data, may also have another clie ...
-
JAVA interview questions
JAVA interview questions 1, object-oriented features of what has 1. Abstract 2. Inheritance 3. Packaging 4. Polymorphisms 2, String data types are the most basic right? Basic data types include byte, ...
-
JAVA Class naming convention
1. Entity Layer: Inheritance: All categories inherited from BasicEntity, one of BasicEntity implementation java.io.Serializable interface; Naming rules: Class Name = Object + type suffix, one of type ...
-
Struts2 + hibernate + spring problem user log in
dao layer services layer action jsp user name: Password:








Responses to “Great collection of java interview topics”