Java Various Concepts Core Java summary

Source: Internet
Author: User
Tags bitwise logical operators object model serialization

What is base:ooa? What is ood? What is oop? {oo (object-oriented): based on object concept, object-centric, class and inheritance as the construction mechanism, to recognize, understand, portray the objective world and design, to build a corresponding software system of a method; the intention----simulate the human way of thinking, make development, maintenance, modification easier  -    ooa (object-oriented analysis): The emphasis is on the systematic investigation data, based on the Oo method required for the collation of the material to be analyzed and organized, rather than The analysis of the current situation and methods of management Business-------is to further refine oo, to obtain the properties and methods of the OO (or simply understand: a rough definition of the interface in the resulting Document)  -    ood ( Object-oriented design): an intermediate transition in OO method, whose main function is to further standardize the results of OOA analysis so that it can be directly accepted by oop------to organize and define OO properties and methods  -     oop (object-oriented programming): separates the implementation of the component from the interface and allows the component to be polymorphic----(abstract, inheritance, encapsulation, polymorphic) interface-oriented programming?  - } are: object-oriented analysis, object-oriented design, object-oriented programming   abstraction: The concept of inheritance: a new class of objects can be derived from existing classes, which is the inheritance of classes, which inherit the attributes of the parent class. Subclasses can inherit methods and instance variables from the parent class, and subclasses can modify or add new methods for better Use. {inheritance mainly implements reusing code, saving development time. } Encapsulation Concept: {encapsulation is the first step in implementing object-oriented programming, and Encapsulation is the collection of data or functions in a unit (what we call a class). Encapsulated objects are often referred to as abstract data types.  } polymorphism Concept: constructors cannot be override but can be overload. {polymorphic: the same operation acts on different objects and can have different interpretations, resulting in different execution results. At run time, you can invoke methods in the derived class by pointing to a pointer to the base class. Can the}  interface inherit interfaces? Can an abstract class implement an interface? Does an abstract class inherit entity classes? yes, yes, You Can. The difference between  overload and override is that the polymorphism is different, and override is the parentA representation of polymorphism between classes and subclasses, overload is a representation of polymorphism in a class. The overload itself is independent of the return value, so it is possible to change the return Value. {override is overridden: the method name, the number of arguments, the type, the order, and the return value type must be consistent with the parent class Method. Its relationship is that the parent-child relationship overload is overloaded: the method name is not changed, and the rest is subject to Change. Its relationship is the same class, the same method name, different method parameters, or return Values. Note: They are all different manifestations of Java Polymorphism} abstract class and interface can have non-abstract methods in the abstract class, and interfaces are not available. Abstract classes can inherit only from a sheet and interfaces can implement multiple Inheritance. The difference between  & and && & is the bitwise operator, which indicates that the bitwise AND operation,&& are logical operators, which represent the difference between the logic and the (and)  int and the integer two different types of java, The base data type and composite type, integer is the encapsulation type of int, and provides multiple method invocations. There are also differences in the speed of operation, and the basic data types run Faster. Is  string the most basic type of data? The basic data types are only the following 8 kinds: Boolean,byte,char,short,int,float,long,double. So string is not the most basic data type. The difference between  string and StringBuffer is that strings can be stored and manipulated, string provides a numeric immutable string, and StringBuffer can modify the String. Whether   can inherit the string class is not possible, and the string class is Final. The difference between  final,finally,finalize final is the final form modifier, when the variable is modified, this variable is constant, when the method is decorated, this method cannot be overridden, and when the class is decorated, this class cannot be inherited. Finally is part of the EXCEPTION-HANDLING statement structure that represents the block of statements that will always be executed. Finalize is a method in object that invokes the method of the reclaimed object when the garbage collector executes to release some Resources.  string s = new string ("xyz") altogether created several string objects? Two a different static inner class of {one or Two} static Nested class and inner class can be instantiated without relying on an external instance, whereas an inner class needs to be instantiated after an external class Instantiation. What is  gc? Why do we have a GC? A GC is a garbage collector, and programmers often forget or mistakenly make memory recoveries that cause programs or systems to become unstable or even crash, and Java uses GC to automatically reclaim Memory.  abstract method can be static at the same time, whether it can be native at the same time, whether it can be synchronized at the same time. Does the   array have the length () method? String has no length () method no;  switch can function on a byte, can function on a long, can function on a string switch can only act on the following types: Byte,char,short,int.   Two object values are the same, but can have different hashcode this is not true, the values are the same, hashcode must be the Same. is  java a value pass or a reference pass? Value is passed, an object is passed into a method as a parameter, the value is changed, and after this method ends, the changed value is preserved because the value of the parameter is a reference to the object, so the reference is actually different, but the object is the Same.  java interface and C + + virtual class of the same and different Java interface and C + + virtual class can implement multiple inheritance, just C + + virtual class is similar to Java abstract class. &NBSP;JVM the mechanism of loading class files The load of classes in the JVM is implemented by ClassLoader and its subclasses, ClassLoader is an important Java Runtime system component that is responsible for locating and loading class file classes at Run Time. Can a  char variable store a Chinese character? yes, because in Java encoding in unicode, a char occupies 16 bytes, so you Can.   Logical operations (&AMP;,|,^) and conditional operations (&&,| |) The differential condition operation can only operate on the Boolean type, and the logical operation not only operates a Boolean but also operates on numeric types. The logical operation does not cause a short circuit.   Whether a call to a Non-static method can be issued from within a static method is not Possible.   When writing the clone () method, there is usually a line of code, what is it? Clone has a default behavior, super.clone (), is responsible for generating the correct size of space, and bit-wise Replication.   The difference between static and instance variables static variables are class-owned, and each instance of a class is shared with that variable, so the values are consistent for each instance. Instance variables are unique to each instance, so for each instance, the value of the instance variable guarantees some state of its own.  anonymous Inner class can inherit otherClass or implementation interface. Is there a goto in  java, a reserved word, but not used.   The difference scope of the access modifier   Current class   Same package   subclass   Other  public √ √ √ √ protected  √ √ √ x default (when not Written)  √ √ x x private √ x x What language is  x  java to improve the redesign? Which of the following words is c++  right? program after compiling generated machine program compiled after the creation of a byte program after compiling dlld. all of the above are incorrect answers:b  The following statements are correct in the A.class constructor cannot be omitted B.constructor must have the same name as class, but the method cannot have the same name as Class C.constructor when an object is new, D. A class can only define one constructor answer :c  The following statements are Correct. A. Formal parameters can be treated as local Variableb. a formal parameter can be modified by a field modifier c. parameter is called when the method is invoked, the argument that is actually passed the D. formal parameter cannot be an object Answer: A public class a{   int x = 10;  public A () {         //construction method   system.out.println ("a ' s Constructor ");                              &NB Sp                          ,         &NB Sp &nBsp      add (2);    }  public void add (int y) {   System.out.println ("A ' s add Method")   x+=y;  }}class B extends a{  int x = 9;   public b () {  system.out.println ("b ' s constructor");   }  public void add (int y) {   system.out.println ("B ' s add method");   x+=y;  }  public static void Main ( String []args) {  a A = new B ();   system.out.println (a.x);   b b = new B ();   System.out.println (b.x);   a c = new A ();   system.out.println (c.x);  }}  What is the result of the above program output?  10,9,12{a's constructorb's Add MethodB ' s constructor10a ' s constructorb ' s add methodB ' s constructor9a ' s Constructora's Add method12} exception: What is the difference between a run-time exception and a generic exception represents an unhealthy state that may occur during a Program's run, and a Run-time exception that represents an exception that might be encountered in a virtual Machine's usual Operation. is a common run Error. The Java compiler requires the method to declare a Non-runtime exception that might occur, but does not require that a runtime exception that is not caught to be thrown must be declared. The difference between  error and exception error indicates a serious problem in recovering a very difficult, generalThrown by the OS or jvm. Exception represents a design or implementation problem, typically generated and thrown by the running program Itself. There is a return statement in the  try, and the code in the finally after the try will be executed before the Return. Collection: say Arraylist,vectory,linkedlist storage performance and features ArrayList and vectory implement a linear structure, traversing elements, high efficiency, LinkedList realized the chain table structure (bidirectional loop), Insert and delete are more efficient, ArrayList is thread asynchronous, vectory is thread synchronization, so execution efficiency vectory low, But data security is High. The difference between  collection and collections collection is the parent interface of the set frame, and its direct subinterfaces are mainly set and List. Collections is a tool class for collection classes that provides a series of static methods for searching, sorting, threading, and so on for various collections. The difference between  hashmap and Hashtable  hashtable method is synchronous and HashMap not, In addition HashMap allows a null as key, and Hashtable does not allow   What is the difference between heap and stack? a stack is a linear set that is processed in the advanced post-out (FILO) manner. Heap is a constituent element of a stack. {1.heap is a heap, stack is a stack. 2.stack of space is automatically allocated and freed by the operating system, and heap space is manually applied and released, and the heap is commonly assigned with the new Keyword. 3.stack space is limited, and the heap space is a large free zone. In java, If you just declare an object, it is assigned an address space in the stack memory, and if you instantiate it again, it is assigned an address in heap memory. 4. example: Data type   variable name; so define something in the stack Area. Such as:object a =null;  only allocates space new  data type () in stack memory, or malloc (length);  such defined things are in the heap area such as:object b  =new object ();  allocates space in heap memory} list,set,map inherit from collection interface? List,set is; Map is Not. The elements in the  set cannot be duplicated, so what is the way to distinguish between repetition? is with = =or equals? What's The difference? Use iterator to differentiate whether or not to repeat. = = Determines the address, equals determines whether the content and type are the Same. What are the characteristics of the  list,set,map interface? The list holds elements in a unique order and can be repeated. Set internal sort, not Repeatable. The map interface stores data in Key-value pairs, which cannot be duplicated and values can be duplicated. The difference between thread:sleep and wait is that sleep is a thread-like method that causes this thread to pause execution for a specified time and transfer control of the CPU to other threads, but the monitoring state remains and Resumes. Wait is a method of the object class that calls the wait method on this object to cause this thread to discard the object lock, enter the waiting lock pool waiting for this object, and only after the Notify or Notifyall is issued for this object will the thread enter the object lock pool ready to get the object lock into the running State.   Synchronous and asynchronous differences in the concept of exclusive locks, synchronization for thread monopoly, asynchronous for shared use, synchronization will result in inefficient running, and asynchronous may cause State conflicts when multiple threads concurrently access Resources.   When a thread enters a synchronized method, does the other thread have access to other methods of this object? Could enter into his other methods, and not enter that One.   briefly describes the similarities and differences between synchronized (synchronous) and Java.util.concurrent.locks.Lock lock to complete all the functions that synchronized Implements. Lock has a more precise line semantics and better performance than the Synchronized. Synchronized will automatically release the lock, and lock must require the programmer to release it manually, and it has to be released in Finally.   What methods do I need to invoke to start a thread? Start Method. But it does not mean that the thread is started, but is in a pending state. Thread initiation calls the run Method. How many types of streams are there in io:java? According to different classification can be divided into: input stream and output stream, byte stream and character stream, node stream and media stream.  {depending on whether the stream is directly connected to a specific place (such as disk, memory, device, etc.), It is divided into two categories: node stream and processing Stream. Node Flow: you can read and write data from or to a specific place (node).  such as Filereader. Processing Flow: is the connection and encapsulation of an existing stream, which implements the data read and write through the functional invocation of the encapsulated Stream. such as Bufferedreader. the construction method of the processing stream always takes an additional stream object to do the Argument. A Stream object passes through multiple wrappers of other streams, called links to Streams. }  What is Java serialization, How to implement Java serialization serialization is a way to handle theLike the flow mechanism, the so-called object flow is the content of the object to flow Flowers. It is possible to read and write to a fluidized object, or to transfer the streamed object between the Networks. Serialization is a problem that is raised when reading and writing to an object Stream. JDBC: What technology should be used to manage database connections if multiple users are accessing the database at the same time? Database connection pooling can be used.  java the steps to access the database, the difference between statement and preparedstatement? (1). Registration Driver (2) Create connection (3) Create execution Object (4) Execute SQL statement (5) process result set (6) close connection PreparedStatement is a precompiled processing statement that keeps the statement itself in memory and is highly efficient when executed multiple times.  jdbc How to implement paging JDBC paging is divided into two kinds of database paging and application Page. Application paging requires that all eligible data be fetched at once, stored in an array or dynamic array, and then extracted as Required. Database paging is different in the same way as the database, such as when the MSSQL is paged by top, and Oracle is paginated according to the Pseudo-column. The method of   transaction processing connection has 3 kinds of transaction processing schemes: setautocommit (boolean) autocommit, commit () commit, rollback ROLLBACK. What are the Xml:xml document definitions in several forms? What is the essential difference? What are the different ways to parse an XML document? There are two ways of DTD and Schema. The essential difference is that the schema is a well-formed XML document, and the addition of type designations, namespaces and other content, more suitable for the definition and specification of XML Documents. There are several ways to parse an XML document, such as Dom,sax,jdom. What are the applications of  xml in the project? Temporary data storage and delivery: when Ajax technology passes data from the background to the foreground, it can be written in the form of an XML document for delivery and parsed in the Foreground. Configuration files: such as data source configuration, Framework configuration, javaweb application Information configuration, etc. Java Web:servlet Life cycle, say the difference between servlet and CGI life cycle: new>init>service>destory. CGI generates new processes for each request, and the servlet serves each request in a multithreaded manner. CGI is less efficient. The difference between  forward and redirect forward is that the server requests the resource, the server directly accesses the destination address url, reads the response content of the url, sends it to the browser, and the browser does not know where the server obtains the content, so the address bar does not change.Redirect is the server based on logic, sending a status code to tell the browser to re-request an address. The request is unchanged after forward, and the request has changed after Redirect. The   dynamic include and static include difference dynamic include is implemented with the Jsp:include action, which always checks for changes in the included files, is suitable for containing dynamic pages, and can take Parameters. Static include does not check for changes in the included files, and is suitable for containing static pages.   How database connection pooling works The Java EE server starts with a certain number of connections and maintains a connection of not less than this number of connections, with two states, busy and Idle. Increase and decrease the number of connections by customer Traffic. When all connections are busy, the connection pool increases the number of connections, and when most connections are idle, the connection pool automatically cleans up some connections.  jsp's built-in object and method request represents the HttpServletRequest Object. It contains information about the browser request and provides several useful ways to get the cookie, header, and session Data. Response represents the HttpServletResponse object and provides several methods for setting the response to the browser (such as cookies, header information, and so on). The Out object is an instance of Javax.servlet.jsp.JspWriter and provides several methods that you can use to echo the output to the Browser. PageContext represents a Javax.servlet.jsp.PageContext Object. It is an API for easy access to a wide range of namespaces, servlet-related objects, and a way to wrap generic servlet-related Functionality. The session represents a requested Javax.servlet.http.HttpSession Object. Session can store the User's status Information. Applicaton represents a Javax.servle.ServletContext Object. This helps to find information about the servlet engine and the servlet Environment. Config represents a javax.servlet.ServletConfig object. This object is used to access the initialization parameters of the servlet instance. Page represents a servlet instance that is generated from this Page. Exception records the exception information in the page that can only be accessed in pages that have page directive properties iserrorpage= "true".  jsp Common directives page, taglib, include  when calls to the GoGet () and Dopost () servlet invoke the service method when a user request is received, this method invokes the appropriate method based on the type of request (get or post).  jsp and Sevlet are the same and different, what is the connection? JSP is the evolution and extension of servlet technology, JSP is more emphasis and suitable for the view layer, servlet is more suitable for the control layer. What technologies are available for each part of the  mvc? In Java Web applications, The M layer is implemented by javabean, the V layer is implemented by JSP or html, and the C layer is implemented by the Servlet. What are the 6 basic actions of  jsp? What is the role? The include action is used to dynamically include a file. The Usebean action is used to get an object of the specified name and type within the specified Range. The SetProperty action is used to assign a value to the specified Object. The GetProperty action is used to take a value on the specified property of the specified Object. The forward action is used to forward the request to another Page. The plugin action is used to generate an object or embed tag for a Java plug-in. The difference between  get and post get the form data in the form of variable=value, which is appended to the URL that the action points to, and both use "? "connect, use the" & "connection between the variables; post is the data in the form that is placed in the data body, and is passed to the URL of the action in the way that the variable and the value Correspond. Get is unsafe; post is relatively secure. Get is limited by URL length, The amount of data transferred is small, Post can transfer large Data. Get restricts the data set of a form form to be ASCII characters, while post supports the entire ISO10646 character Set.  servlet2.2 The basic directory structure of the Web application above webapps---| |---application---|  |----jsp page  |---- web-inf--| |----classes | the four ranges----web.xml jsp of the lib | page are the objects and properties that are related to one of the Pages. Request is a pair of western-to-west and a property that represents a request made by a web client, which may span multiple pages. A session is a representation of the objects and properties associated with a user experience for a web Client. A Web session can span multiple customer requests. ApplicAtion represents objects and properties related to the entire web Application. spans the entire web application, including multiple pages, requests, and Sessions. What are the uses of   filters? Filters mainly do interception, so can do a lot of things, such as filtering some illegal words, verify whether the normal landing, character encoding Conversion.   Usage of filters? Implements the filter interface, overwriting init (filterconfig config), doFilter (servletrequest request,servletresponse response,filterchain Chain) , Destroy () Method. How do I use JavaBeans in  jsp? JSP has standard actions for JavaBean operations, How are request forwarding in usebean, setProperty, getproperty jsp, and Servlet implemented separately? JSP can be implemented using the forward Action. Both the JSP and the servlet can use Request.getrequestdispatcher (path). forward (req,res) for request Forwarding. The role of  web.xml is used to configure Web application information, such as Servlet,filter. Whether JavaEE:Base:J2EE is a technology or platform or framework Java EE itself is a standard, a standard platform for the development of Enterprise distributed Applications. The Java EE is also a framework, including jdbc, JNDI, RMI, JMS, EJB, JTA and other Technologies.   Please explain the following EE nouns: web container, ejb container, JNDI, JMS, JTA, JAF, rmi/iiopweb Container: provides an environment for the application component (jsp, Servlet) in which to make jsp, The servlet interacts directly with the environment variable interface in the container without having to focus on other system Problems. The interface provided by the container strictly complies with the WebApplication standard in the Java EE specification. Web servers that adhere to the above criteria are called Java EE Web containers. EJB container: Enterprisejavabean Container. It has the industry domain characteristic more. Provides a variety of management functions to the component EJB running in it. As long as the EJB that satisfies the Java EE specification is placed in the container, it is immediately managed efficiently by the Container. And the System-level services can be obtained through the existing Interfaces. JNDI: (java Naming & directory Interface) Java named directory Service. The main features are: to provide a directory system,Allow applications from other parts of the world to leave their own indexes on top of one another to meet the ability to quickly find and locate distributed Applications. JMS: (java message service) java messaging Services. The main implementation of communication between the various Applications. Includes point-to-point and Broadcast. JTA: Java Transaction service (java Transaction API). Provides a variety of distributed transaction Services. The application simply invokes the interface it Provides. JAF: Java Security Authentication Framework (java Action framework). Provide some framework for security Control. Let developers implement their own personality security control strategies through a variety of deployments and Customizations. RMI/IIOP (remote Method invocation/internet Object Request Mediation Protocol) They are primarily used to invoke services Remotely. Struts: What is struts? Struts is intended as a structure, in the Java EE for a web framework, the use of Jsp/servlet/javabean technology. You can develop an application architecture based on the MVC Pattern.  struts's entry class? actionservlet, all requests to the action are forwarded through the class. Hibernate: What is orm? Object Relational Mapping. is a technique to solve the non-matching phenomena of object-oriented and relational Database. Objects in a Java program are automatically persisted to the relational database by using metadata that describes the mappings between the object and the Database. What are the advantages of  hibernate than jdbc? The problem of impedance mismatch between the object model and the relational model is Solved. Hibernate is flexible and easy to use, and uses a lot of configuration files and mapping files to solve the correspondence between classes and tables or views for easy maintenance. Perfect transaction processing and leveraging caching for Performance. What are the 5 core interfaces of the  hibernate configuration: hibernate is configured to create Sessionfaction objects according to their startup Hibernate. Sessionfactory: initializes hibernate, acts as a proxy for the data storage source, creates session objects, Sessionfactiory is thread-safe, and the same instance can be shared by multiple threads that are Applied. Session: responsible for saving, updating, deleting, loading and querying objects, thread insecure, need to avoid multiple threads sharing the same session. Transaction: managing Transactions. Query and Criteria: execute queries for the Database.   about hibernate, configuration files render one-to-many, Many-to-many tags? HibeWhat is the level two cache for rnate? How does hibernate handle transactions? A one-to-many label is <one-to-many&gt, and many-to-many tags are <many-to-many>. The cache for Sessionfactory is Hibernate's level two Cache. Hibernate's transaction is actually the encapsulation of the underlying JDBC transaction or JTA Transaction. The JDBC Transaction is used by Default.  hibernate the relationship of a property in a map file to a column in a table, such as the type in the table that corresponds to a property string? Character type, such as char,varchar, or large text.  hibernate paged Implementation code query query = session.createquery ("from Emp"); query.setfirstresult (first); query.setmaxresults (pageSize); Collection Emps = query.list (); The difference between load and get in  session when the given object identity does not exist, get returns null, and load throws an Exception. Spring: A brief description of the spring Framework. The spring framework is a layered architecture consisting of seven well-defined modules, which are built on top of the core container, and the core container defines how the beans are created, configured, and Managed. Each module that makes up the spring framework can exist separately or be implemented in conjunction with one or more modules. What are the technologies for Spring Core, Spring Context, Spring AOP, Spring DAO, Spring ORM, Spring Web, Spring MVCEJB:EJB The difference between Sessionbean and Entitybean EJB includes sessionbean,entitybean,messagedrivenbean, based on jndi, RMI, JTA and other Technologies. 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 temporarily store Data. The difference between &NBSP;EJB and JavaBean JavaBean is a reusable component, there is no strict specification for javabean, and any Java class can be a bean, but since JavaBean is usually created by a container, JavaBean should beThere is an Argument-free constructor that implements the serializable interface for persistence, and JavaBean is not accessible across Processes. EJB is a java-based rmi technology, so EJBS can be accessed remotely (across processes, across computers). however, EJB must be deployed in a container that supports EJBS (such as webspere,weblogic, etc.), and EJB clients do not directly access EJB components but are accessed through Containers.   illustrates the lifecycle of Sessionbean and Entitybean in ejbs, and how the transaction management Sessionbean:statelesssessionbean life cycle is determined by the container, When a client makes a request to establish an instance of a bean, the EJB container does not have to create a new instance of the bean for the client to invoke, but instead to find an existing instance to provide to the Client. When a client invokes a Statefulsessionbean for the first time, the container immediately creates a new bean instance in the server and associates it to the Client. later, When this client calls the Statefulsessionbean method, the container dispatches the call to the bean instance associated with the Client. Entitybean:entitybean can survive for a relatively long time, and the state is Persistent. As long as the data in the database exists, Entitybean has Survived. Instead of ending life as an application or service Process. The Entitybean life cycle can be managed by the container or bean itself. EJB manages transactions through the following technologies: OTS (Object Transaction service), JTS (java Transaction service), JTA (java Transaction API)   EJB role and three objects a complete ejb-based distributed computing architecture consists of six roles, and each role must work with the EJB specification provided by Sun to ensure compatibility with each other. These six roles are EJB component developer (Enterprise Bean Provider), application composition (application assembler), deployer (Deployer), EJB service provider (EJB Serverprovider) , the EJB container provider (EJB Container Provider), and the system administrator (systems Administrator). The three objects are the remote (Local) interface, the Home (localhome) interface, and the bean class. The services provided by the &NBSP;EJB container provide life cycle management, code generation, continuous management, SecurityServices such as full, transaction management, lock, and concurrency Management. &NBSP;EJB What actions are forbidden 1. cannot manipulate thread and thread APIs (thread API refers to methods such as notify,wait for non-threaded objects). 2. Cannot operate AWT. 3. Server functionality cannot be Implemented. 4. Cannot access the static Property. 5. The file system cannot be accessed directly using IO operations. 6. The local library cannot be Loaded. 7. You cannot use this as a variable and return. 8. The call cannot be Looped. The  remote interface and home interface primary function remote interface defines the business method used by the EJB client to invoke the business Method. The home interface is used by the EJB factory to create and remove lookup EJB Instances. The life cycle of an  bean instance has buffer pool management for stateless session bean, entity bean, Message driven bean, and for entity Bean and Statefull session The bean has cache management, which typically includes creating instances, setting contexts, Creating Ejbobject (create), Business Method calls, and remove, and for beans with buffer pool management, The instance is not purged from memory after the Create. instead, the buffer pool scheduling mechanism is used to continuously reuse instances, while the beans that exist in cache management maintain the state of the bean through activation and deactivation mechanisms and limit the number of instances in Memory. The activation mechanism of &NBSP;EJB takes the stateful Session Bean as an example: its cache size determines the number of bean instances that can exist concurrently in memory, and according to the MRU or NRU algorithm, the instances are migrated between the activation and deactivation states, The activation mechanism is when the client invokes an EJB instance business method, and if the corresponding Ejbobject discovers that it does not bind the corresponding bean instance, it activates (activates) the instance from its active bean store (through the serialization mechanism storage instance). The corresponding ejbactive and Ejbpassivate methods are called before the State Changes. Several types of &NBSP;EJB are session bean,entity Bean and message driven Bean. The session bean can also be divided into stateless session Bean and stateful session Bean. The Entity bean can also be divided into bean management persistence (BMP) and container management persistence (CMP).   Customer service The basic steps of invoking the EJB object are setting the Jndi Service Factory and Jndi service address system properties, finding the home interface, calling the Create method from the home interface and creating the remoteInterface that calls its business methods through the remote INTERFACE. Rdbms&sql:3 Table Student Student table (school number, name, gender, age, organization department), Course Timetable (number, Course name), SC selected timetable (student number, course number, score). Write an SQL statement that queries the student number and name of the "computer principle". Write an SQL statement and query the name of the course "stephen Chow chi" Students. Write an SQL statement that queries the student number and name of 5 Courses. Write an SQL statement that queries the student number and name of all Courses. (1) Select Sno,sname from student Stu where Stu.sno in (select Sc.sno from sc WHERE sc.cno = (select course.cno from course Where CNAME like ' computer principle '); (2) SELECT cname from course cou where Cou.cno in (SELECT sc.cno from SC where Sc.sno in (selec T Student.sno from student where sname like ' Stephen Chow Chi ')); (3) SELECT student.sno,sname from student where Student.sno in (select Sc.sno from SC GROUP by Sc.sno have count (*) =5); (4) SELECT student.sno,sname from student WHERE Student.sno in (SELECT SC . Sno from SC GROUP by Sc.sno have count (*) = (SELECT count (*) from course);  has an emp, table field (empno,ename,mgr,age), Write a statement to query the list of all employees who are older than their leaders. Select Worker.ename from emp worker where worker.age> (SELECT manager.age from emp Manager where Manager.empno = Worker. mgr);  has two tables representing the province and city information, where the Province Information table fieldFor (stateno,statename), the City information table in the fields (cityno,cityname,stateno), the Provincial information table in guangdong, jiangsu, liaoning, heilongjiang, The City information table in shanghai, guangzhou, beijing, nanjing. Now you need to find out all the city information and the relevant province information, please write the query Statement. SELECT Cityname,cityno,s.stateno,s.statename from city c,state s WHERE c.stateno = S.stateno (+); Base web:javascript A dynamic drop-down list, how do i show all the selected values after each click? <script type= "text/javascript" > function Choose (sel) {  alert (sel.options[sel.selectedindex] . innerHTML);     }</script><select onchange= "choose (this)" > <option>1</ Option> <option>2</option> <option>3</option></select> Encapsulation of a class, Contains the property name and sex, after setting its value and then removing  function myObject () {var innerclass = new Object (); ' undefined '; ' undefined '; innerclass.setname = function (n) { name = n;} Innerclass.setsex = function (s) {sex = s;} Innerclass.getname = function () {return name;} Innerclass.getsex = function () {return sex;} Return innerclass;}

Java Various Concepts Core Java summary

Related Article

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: 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.