The most comprehensive Java face test-----is your better grasp of Java knowledge

Source: Internet
Author: User
Tags data structures exception handling float double goto logical operators serialization truncated

The most comprehensive Java face test-----is your better grasp of Java knowledge

Directory

L Concept Title---1

One, Java Foundation---1

1 Object-oriented features---1

2 What is OOP. What is a class. Compare the relationship between the class and the object instance. ---1

3) briefly describe the concept of class and object---2

4 What is the attribute and method. ---2

5 What is encapsulation. ---2

6 describes the principle mechanism of the JVM loading class file---2

7 How to optimize the Java program. ---2

8 whether a ". Java" source file can include multiple classes (not inner classes). There is no limit. ---2

9 char variable can be stored in a Chinese character---3

10 logical operators (&,|,^) and conditional operators (&&,| |) The difference---3

One) Math.Round (11.5) how much? Math.Round (-11.5) is equal to how much. ---3

Java has no goto. ---3

The difference between int and Integer---3

14 How to convert numeric characters to numbers. How to go decimal rounding to keep two digits after the decimal point. ---3

(a) short S1 = 1; S1 = s1 + 1; and short S1 = 1; S1 + 1; what's wrong---3

is float f=3.4 correct?-4

The difference between String and StringBuffer---4

A string is the most basic data type and can be inherited---4

string s = new string ("XYZ"); several string Object created. ---4

20 does the array have a length () method? String has no length () this method. ---4

21 How to sort all kinds of methods. Implement a quick sort---in Java 4

Swtich whether it acts on a byte, whether it acts on a long, whether it acts on a string---5

23 in Java, how to jump out of the current multiple nested loops. ---5

24 on the date and time of several issues---5

25 An object is passed as a parameter to a method, whether it is a value pass or a reference pass---5

26 when to use Assert. ---5

) What is the GC? Why should there be a GC. ---5

28 The advantages and principles of garbage collection---5

29 The garbage collector can reclaim the memory immediately. What is the way to actively notify the virtual machine for garbage collection. ---6

There is a memory leak in Java, please briefly describe---6

There are several types of streams in Java. The JDK provides a number of abstract classes for each type of stream for inheritance, which are the classes they are respectively. ---6

32 File and directory (I/O) operations---6

33 What is Java serialization. How to implement Java serialization. ---7

Java Event Delegation mechanism concept---7

35) Talk about your understanding of Swing's MVC pattern. ---7

How the MVC structure is implemented in JTable, what is the benefit of this structure? ---8

Ii. class and inheritance---9

37 say some commonly used classes, packages, interfaces, please lift 5---9

38) What are the advantages of the interface. ---9

39 The difference between a static variable and an instance variable---9

40 whether a call to a non-static method can be emitted from within a static method. ---9

Java has several modifiers. Respectively used to modify what. ---9

42 scope public,private,protected, and not write when the difference---10

Final, finally, finalize the difference---10

44 The inner class can refer to the members of the class that he contains. There are no restrictions. ---10

45 whether anonymous inner classes can inherit other classes. Whether the interface can be implemented. ---10

The mechanism of implementing polymorphism in Java. ---11

The difference between overload and override, the overloaded method can change the type of return value. ---11

The difference between abstract class and interface---11

49 interface can inherit interface? Does an abstract class implement an interface? Can an abstract class inherit an entity class?-11

Whether the method of abstract can be static or native or synchronized at the same time. ---11

51 whether the constructor constructor can be override-11

52 When writing the Clone () method, there is usually a line of code, what is. ---12

Overview of the object class---12

Third, abnormal---13

The simple principle and application of exception handling mechanism in Java. ---13

How does the Java language handle exception handling, keywords: what is the meaning of throws,throw,try,catch,finally respectively?    Can I throw an exception in a try block. 13

The difference between error and exception---13

57 The difference between the Run-time anomaly and the general exception---14

58) Give me one of your most common runtime exception (Run-time exceptions) 14

There is a return statement in the try, and the finally code will not be executed. Execute before or after return. ---14

Four, set---15

60 What are the collection classes---15

61) Introduction of collection FrameWork-15 in Java

The difference between ArrayList and vector---15

The difference between HashMap and hashtable---15

The difference between Collection and collections---16

65 say Arraylist,vector, LinkedList storage performance and characteristics---16

The difference between heap and stack---16

List, Set, or whether the map inherits from the collection interface. ---16

List, Set, map three interfaces, when accessing elements, each have what characteristics. ---16

The elements in set cannot be duplicated, so what is the way to distinguish between duplicates or not? Is it with = = or equals ()?    What is the difference between them. 17

70) Two object values are the same (x.equals (y) = = true), but they can have different hash code, which is not the correct sentence---17

Five, multithreading---18

71 start a thread with run () or start (). ---18

The difference between sleep () and wait ()---18

Why the Stop () and Suspend () methods are not recommended for use. ---18

74 What are the similarities and differences between synchronization and Asynchrony, and under what circumstances they are used separately---18

75 when a thread enters an object's synchronized method, other threads can enter other methods of this object---18

76 Thread Synchronization Method---19

77 multithreading has several implementation methods---19

78 The basic concept of the thread, the basic state of the thread, and the relationship between the states---19

79) A brief description of similarities and differences between synchronized and Java.util.concurrent.locks.Lock---19

80 The advantages of multithreading---19

Vi. JDBC and database-related---21

Bayi) The role of class.forname? Why use?-21

JDBC The basic steps for invoking a database---21

83 name The working mechanism of the data connection pool. ---21

What is JDO?-21

85 How to implement Dynamic query. After the structure of the table changes, if you do not need to modify the program, how to design and implement the query. ---21

86 How to optimize the database, how to improve the performance of the database. ---21

87 Design database should pay attention to those problems---22

88 The relation between table and table---22

89 The difference between primary key and foreign key---22

90 noun explanations: batches, triggers, transactions, locks, subqueries, indexes, views, stored procedures---22

91) The role of the cursor. How to know that the cursor has arrived at the end. ---23

92 What is the difference between triggering beforehand and triggering afterwards? What is the difference between a statement-level trigger and a row-level trigger. ---23

93 the necessity of database design and design steps---24

94 What is the data model. What is normalization. ---24

95) talking about the three paradigms of database design---24

Seven, JSP and Servlet 25

The difference between forward and sendredirect---25

The difference between dynamic include and static include in JSP---25

The built-in objects and methods of JSP---25

JSP's Common instructions---25

100 Name The lifecycle of the servlet and tell the difference between the servlet and the CGI---26

101 Under what circumstances call Doget () and Dopost () 26

102 How to realize the single thread mode of the servlet---26

103 Description of the role of cookies and sessions, differences and their respective scope of application, session working principle---26

104 The method of passing objects between pages---27

What are the similarities and differences between the JSP and the servlet, and their connection---27?

106) Four kinds of Session tracking technology---27

Main method of Request object---27

108) What are the common methods for implementing a servlet---28

109 say in the JSP page is how to pagination?-28

Eight, the basic---of Java EE 29

What is the Java EE? ---29

The commonly used nouns in Java-ee are explained---29

112 noun Explanations: WEB SERVICE, JAXP, JAXM, SOAP, UDDI, WSDL-30

113) is the technology or platform or framework of Java EE. ---30

114) XML document definitions have several forms. What are the essential differences between them? There are several ways to parse an XML document. ---30

115 What aspects of XML technology did you use in your project? How to achieve it?-31

116) The common design pattern of Java EE. Description of Factory mode---31

Nine, STRUTS-32

117) What technologies are available in all parts of MVC? How to implement?-32

118 outlines struts, and how struts implements the MVC architecture. ---32

119) A brief description of the main functions of struts---32

The processing process of struts---32

Ten, EJB-34

121) EJB2.0 What are the contents? The difference between EJB2.0 and EJB1.1?-34

122 the difference between EJB and Java Bean. ---34

123) EJB is based on which technologies are implemented. And tell the difference between Sessionbean and Entitybean,statefulbean and Statelessbean 34

124) EJB includes Sessionbean and Entitybean, speaking about their lifecycle, and how to manage transactions. ---35

The role of EJB and three objects---35

126) EJB Container provides services---35

127) The EJB specification prescribes what operations are prohibited in the EJB. ---35

128) remote interface and home interface main role---36

129) The life cycle of the bean instance---36

130) The activation mechanism of EJB---36

131) Several types of EJBS---36

132 The basic steps of calling the EJB object on the customer service side---36

(a) EJB need to implement its business interface or home interface directly, please brief reasons---36

XI. Application Server---37

134 The application server has those. ---37

135 the difference between the application server and the Web server. ---37

136 How to give WebLogic the specified size of memory?-37

137 How to set the WebLogic hot start Mode (development mode) and product release mode?-37

138 How to start without entering user name and password?-37

139 What files are actually stored in the WebLogic management console after configuring the relevant information such as JMS and EJB or connection pool for an application domain? 37

140) Talk about the default directory structure of a domain in WebLogic---37

141 What configuration files are involved in distributing EJBS in WebLogic---37

142 How to WebLogic in the SSL configuration and Client authentication configuration or said Java EE (standard) for the configuration of SSL---38

143 How to view the published ejb?-38 in WebLogic

L CORRECTED the wrong question---39

1) # 39

2) # 39

3) # 39

4) # 39

5) # 40

6) # 40

7) # 40

8) # 41

9) # 41

10) # 41

11) # 42

L Programming Question---44

1 Enter a string in the console and print it out in reverse order---44

2 The design of 4 threads, two threads each time to J 1, and two other threads to j each reduction of 1. Write the program. ---44

3 The number of a keyboard input into the Chinese output (for example: input 1234567, output: 120 34,560 pick seven), please use the Java language to compile a program to achieve! 45

4 Write a singleton out---49

5 We often encounter the output of some encoded characters, such as Iso8859-1, in the process of web application development, how to output a string of some encoding 50

6 Enter n numbers now, separated by commas, then select ascending or Descending sort, and press the Submit key on another page to display what sort of order, the result is, provide reset 51

7 Inheritance time class execution sequence question, is generally the choice question, asks you to be able to print what?-52

8) Ibid., about the implementation of internal classes---52

9 on the implementation of the internal class of a choice of questions---53

10 Implement a sort---in Java 54

11 Write a function to intercept the string, input as a string and byte number, and output as a byte-truncated string.    But to ensure that the Chinese character is not truncated half, such as "I abc" 4, should be truncated to "I ab", input "my ABC-def", 6, should be exported as "my ABC" instead of "I abc+ Han half." 55

12 with Java socket programming, read the server several characters, and then write the local display---56

13 Write a section of JDBC Oracle program, and implement data query. 58

Oracle's paging solution for large amounts of data. The Intercept ID method is generally used, as well as a three-layer nested method. ---60

15 the way to parse XML in Java. 61

16 How to solve the Chinese problem when parsing xml file with Jdom? How to parse?-63

L Other---65

1 Describe your most common programming style. ---65


Concept title One, Java basics 1) Object-oriented features

1. Abstract:
Abstraction is to ignore those aspects of a topic that are not relevant to the current goal in order to pay more attention to aspects related to the current goal. Abstraction consists of two aspects, one is process abstraction and the other is data abstraction.
2. Inheritance:
Inheritance is a hierarchical model of coupling classes, and allows and encourages class reuse, which provides a way to articulate common features. A derived class can inherit methods and instance variables from its base class, and the class can modify or add new methods to make it more appropriate for special needs.
3. Package:
Encapsulation is the process and data surround, access to data only through the defined interface. Object-oriented computing begins with the basic concept that the real world can be depicted as a series of fully autonomous, encapsulated objects that access other objects through a protected interface.
4. Polymorphism:
Polymorphism refers to allowing objects of different classes to respond to the same message. Polymorphism consists of parametric polymorphism and inclusion polymorphism. 2 What is oop. What is a class. Compare the relationship between the class and the object instance.

OOP is the abbreviation for object_oriented programming (object-oriented programming). This is mainly to distinguish from the previous process-oriented programming. Refers to the object of the idea of organizing and building the system, which combines functional abstraction and data abstraction, which can reduce the coupling between data and code error probability. Using object-oriented programming technology can enable software developers to write code according to the pattern of people's thinking in the real world, so that software developers can make better use of the code to express the existing objects directly, mapping the problem space directly to the solution space!

Class: That is, class, in object-oriented programming design, specifically uses "classes" to represent user-defined abstract data types (user_defined abstract type). It abstracts multiple objects with the same state, operation, and access mechanisms. Class has three main characteristics of inheritance, data hiding, and polymorphism. Using these three features of the class can better represent things in the real world. A class is an abstraction of the generality of the same class of object instances, and the object is an instantiation of the class. Objects usually as computer simulation thinking, representing the real world of abstraction, an object is like a software module, can provide users with a series of services---can change the status of the object, testing, delivery messages, and so on. class defines the implementation details or data structures of an object. The class is static, the object is dynamic, and the object can be considered a running class. Class is responsible for generating objects, you can briefly describe the concepts of classes and objects by treating the class as a production object's factory (object factory) 3)

The object is the real world entity, objects and entities are one by one corresponding, that is, in the real world every entity is an object, it is a specific concept.
A class is a collection of entities with certain common characteristics, an abstract concept that, in the language of programming, is an abstract data type that is an abstraction of the same characteristic entity. 4 What is the attribute and method.

Different objects have the same characteristics, may be abstract as a certain class, then these characteristics can basically be divided into two categories, one is to describe the static state of objects, is the object's attributes, in the program design, can be called variables; Attributes and methods are the two basic elements of an object, and also the core of our programming work later. 5 What is encapsulation.

As long as there is enough method, there is no need to directly manipulate the object properties, as long as these methods can be invoked to achieve the task to be completed, this phenomenon is called encapsulation, it through the object method of its properties of the operation of the object properties encapsulated within an object, the object with the outside world all through its own methods to achieve, Effectively hides object attributes inside an object. 6) Describe the principle mechanism of the JVM loading class file

The loading of classes in the JVM is implemented by ClassLoader and its subclasses, and the Java ClassLoader is an important Java Run-time system component. It is responsible for finding and loading classes of class files at run time. 7 How to optimize the Java program.

A: To improve Java performance, generally consider the following four main areas:
1, the method and mode of program design
2, the environment of the Java Cloth Department.
3. Implementation of Java application
4, Hardware and operating system
To improve the performance of your Java program, you need to follow the following six steps. (a) Specific performance requirements B) understand the performance of the current program C) find the performance bottleneck of the program (d) Take appropriate measures to improve performance E) Only one aspect of modification to improve performance F) go back to step c and continue to do similar work, until the required performance has been achieved. 8 whether a ". Java" source file can include multiple classes (not inner classes). There is no limit.

OK. Only one class name must be the same as the file name. 9 char variable can be stored in a Chinese character

Can be defined as a Chinese, because the Java encoding in Unicode, a char accounted for 16 bytes, so put a Chinese is no problem

1)

2)

3)

4)

5)

6)

7)

8)

9) 10 logical operators (&,|,^) and conditional operators (&&,| |) The difference

1. Condition Operator:
Can only be used for relational operations, resulting in a short circuit where the expression on the left side of the symbol can determine the value of the entire relationship expression, and then the right-hand expression is no longer evaluated
2. Logical operators:
It can be used not only for relational operations, but also for bitwise operations. There will be no short-circuit, that is, whatever value the left expression takes, the expression on the right is calculated Math.Round (11.5) and so how much? Math.Round (-11.5) is equal to how much.

Math.Round (11.5) equals 12;math.round (-11.5) equals 11.

1)

2)

3)

4)

5)

6)

7)

8)

9)

Ten)

) Java has no goto.

Reserved words in Java are not currently used in Java. the difference between int and Integer

Java provides two different types: reference type and original type (base data type). int is the original Java type, and integer is the encapsulated class provided by Java for Int. Java provides a wrapper class for each original type:
Boolean-boolean Char-character Byte-byte Short-short
Int-integer Long-long float-float double-double

Reference types and primitive types have different characteristics and methods, including size and speed issues, which type of data structure is stored, and so on. The default values that are specified when the reference type and the original type are used as instance data for a class are different: The default value of the object reference instance variable is NULL, whereas the default value of the original type instance variable is related to their type. 14 How to convert numeric characters to numbers. How to go decimal rounding to keep two digits after the decimal point.

1, Integer.parseint ("a");D ouble.parsedouble ("11.22");
2, double num = 2.625; double tmp = math.round (num * 100)  /  100d;

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: info-contact@alibabacloud.com 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.