Java related basics (6)

xiaoxiao2021-03-06  22

101. Does memory leaks in Java? Please briefly describe it.

meeting. Such as: INT I, I2; RETURN (I-I2); // when i is a positive number, i2 is a large negative number. The result will cause a seating, resulting in errors.

102. What is the mechanism for achieving polymorphism in Java?

The method of rewriting Overriding and overloading overloading is a different manifestation of Java polymorphism. Overriding Overriding is a manifestation of polymorphism between parent class and subclasses, and overloading overloading is a manifestation in a class.

103. What is the basic principle of garbage collector? Can garbage collectors recycle memory immediately? Is there any way to actively notify the virtual machine for garbage collection?

For GC, when the programmer creates an object, the GC starts to monitor the address, size, and usage of this object. Typically, the GC uses a map-like manner to record all objects in the heap (HEAP). In this way, it is determined which object is "can be reached", which object is "unreachable". When the GC determines that some objects are "unreachable", GC is responsible for reclaiming these memory spaces. can. The programmer can manually execute System.gc (), inform GC operation, but Java language specification does not guarantee that GC will be executed.

104, differences in static variables and instance variables?

STATIC i = 10; // constant

Class a a; a.i = 10; // variable

105, what is Java serialization, how to implement Java serialization?

Serialization is a mechanism for processing the target stream, the so-called object stream is to fluidize the contents of the object. It is possible to read and write the fluidized object, and the flowable object can also be transmitted between the network. Serialization is to solve problems caused by read and write operations on object flows.

Serialization Realization: The sequential class is required to implement the serializable interface. The interface does not need to be implemented. Implements Serializable is only serialized in order to mark the object, and then use an output stream (such as a fileoutputstream) to construct An ObjectOutputStream (Object Stream) Object, then use the ObjectOutputStream object's WriteObject (Object Obj) method to write the objects of the object (ie, save its status), if you want to recover, you can use the input stream.

106. Can I send a call to a non-Static method from one STITIC method?

No, if it contains Method () of the object; cannot guarantee the initialization of the object.

107, when writing clone () methods, there is usually a line of code, what is it?

Clone has default behaviors, super.clone (); he is responsible for generating the right size space and copying in position.

108, in Java, how to jump out the current multi-nest loop?

Use Break; Return method.

109, List, Map, SET three interfaces, how is it?

List holds an element in a specific order, there can be repeated elements. SET cannot have a repeating element, internally sorted. Map saves the key-value value, Value can be more values.

110, what is J2EE?

J2EE is a Multi-Diered, distributed, distributed, component-based, enterprise application model. In such an application system, it can be divided according to functionality. For different components, these components can be on different computers and are in the corresponding hierarchy (TIER). The hierarchies are included in the ClientN Tier components, web layers, and components, Business layers, and components, and corporate information systems (EIS) layers. 111, UML

Standard Modeling Language UML. Modal example, static map (including class diagram, object map, and package), behavioral diagram, interaction map (sequential diagram, cooperation graph), implementation diagram.

112, say some common class, package, interface, please give 5

Common class: BufferedReader BufferedWriter FileReader Filewirter String Integer

Common package: java.lang java.awt java.io java.util java.sql

Common interface: Remote List Map Document NodeList

113. In the development, the design model is used? What is used?

Each mode describes a problem that has emerged in our environment and then describes the core of the solution. In this way, you can use the existing solutions countlessly without counting the same job. Mainly used in the design pattern of MVC. Used to develop JSP / Servlet or J2EE related applications. Simple factory model, etc.

114, what actions do you have? What is the role?

JSP has the following six basic action JSP: include: Introducing a file when the page is requested. JSP: Usebean: Find or instantiate a JavaBean. JSP: setProperty: Sets the properties of JavaBean. JSP: getProperty: Outputs the properties of a JavaBean. JSP: Forward: Turn the request to a new page. JSP: Plugin: Generate Object or Embed tags based on the browser type.

115, Anonymous Inner Class (anonymous internal class) Can IMPLEMENTS INTERFACE?

You can inherit other classes or complete other interfaces, this way is commonly used in Swing program.

116. The difference between application servers and web Server?

Application Server: WebLogic, Tomcat, JBoss

Web Server: IIS, Apache

117, the connection and difference between BS and CS.

C / S is the abbreviation of Client / Server. Servers typically use high-performance PCs, workstations, or small machines, and use large database systems such as Oracle, Sybase, Informix, or SQL Server. The client needs to install a dedicated client software.

B / S is an abbreviation of Brower / Server, just install a browser, such as Netscape Navigator or Internet Explorer, such as Netscape Navigator, or Internet Explorer, and a database such as Oracle, Sybase, Informix, or SQL Server. In this configuration, the user interface is implemented completely through the WWW browser, and the transaction logic is implemented at the front end, but the main transaction logic is implemented at the server. The browser interacts with the database with the database.

C / S and B / S difference:

1. The hardware environment is different:

C / S typically establishes a private network, a small network environment, and the local area network will then provide connection and data exchange services through a dedicated server. B / S is built on the wide area network, does not have to be a dedicated network hardware environment, Example and telephone Internet access, rent equipment. Information yourself. There is a stronger adaptation range than C / S, usually as long as there is operating system and browser

2. Different security requirements

C / S typically facing relatively fixed user groups, which is very controlled for information security. Generally high confidential information systems are suitable for C / S structures. Open information can be publicly available via the B / S distribution section.

B / S is built on a wide area network, which is relatively weak for security control capabilities, and may facing unknown users.

3. Different program architectures

The C / S program can be more focusing on the process, and you can check the permissions multi-level check, which can be considered less.

B / S has a multiple consideration of security and access speed, based on the more optimized basis. The program architecture of the B / S structure B / S structure is a trend of development, from the MS .NET series BizTalk 2000 Exchange 2000, etc., fully supporting the system for network components. SUN and IBM push JavaBean component techniques, etc., make B / S mature more mature.

4. Software is reused

The C / S program can be inevitable integrally, the reuse of the component is not as low as the reuse of the components of B / S.

The multi-structure of B / S is required to relatively independently. It is relatively good to be reused. If the table buying table can be used, not the stone table on the wall

5. System maintenance

Due to overall performance, the C / S program must be overall, the problematic problems and system upgrades. Upgrade is difficult. Maybe a new system

The B / S component consists of individual replacement, realizing seamless upgrading of the system. The system maintenance cost is minimized. Users can download and install themselves from the Internet.

6. Different problems

The C / S program can handle the user plane, and high demand in the same area, security requirements, related to the operating system. It should be the same system

B / S is built on a wide area network, facing different user groups, dispersing the region, which is C / S that is unable to do. The relationship with the operating system platform is minimized.

7. Different user interface

C / S is mostly established Window platform, the performance method is limited, and the programmer is generally required.

B / S is built on a browser, there is a richer and vivid way to communicate with the user. And most difficulty is reduced, and the development cost is reduced.

8. Different information flow

The C / S program is generally a typical centralized mechanical treatment, relatively low interactivity.

B / S information flows to change, B-B B-C B-G and other information, the flow direction changes, more like the trading center.

118, Linux under the thread, the explanation of the GDI class.

Linux implemented is based on the "one-to-one" thread model of the core lightweight process, and a thread entity corresponds to a core lightweight process, and the management between the thread is implemented in the nuclear external function library.

The GDI class is an image device programming interface class library.

119, Struts application (such as Struts architecture)

Struts is an open source of the open source of the web application using Java Servlet / JavaServer Pages technology. The Struts can develop an application architecture based on MODEL-View-Controller design mode. Struts has the following main functions: I contain a controller servlet to send the user's request to the corresponding Action object. II.Jsp Free Tag Library and provide association support in the Controller Servlet to help developers create interactive form applications. 3. Provide a series of practical objects: XML processing, automatically handle JavaBeans properties, international tips and messages through Java Reflection APIs.

120, what is JDO?

转载请注明原文地址:https://www.9cbs.com/read-46913.html

New Post(0)