The main purpose of this set of interview questions is to help those who do not have practical work experience in Java software development, but are trying to find a Java software development job in the written test of friends to better win the written test and interview.

Due to the scope of this interview question is very extensive, is very wide, very miscellaneous, everyone could not have a day two days after watching and learned the bible of the interview, even if you already learned about the technology, so also need at least a month’s time to digest and to master the bible of the interview, so you need to be prepared early, get this interview from the bible, as of the date of It is necessary to insist on learning a few of the topics in spare time every day, accumulate over a long period of time, and when you go out for an interview, everything will come naturally, and you will be able to do it naturally.

Daxian completed the interview questions and answers in the PDF at the end of the article, stamp the link to receiveInterview questions and answers PDF

Java basic part

The order of the basics: basic syntax, class-related syntax, inner class syntax, inheritance related syntax, exception syntax, threading syntax, collection syntax, IO syntax, virtual machine syntax.

  1. Can a”.java” source file contain multiple classes (not inner classes)? What are the restrictions?
  2. Does Java have a Goto?
  3. What’s the difference between & and &?
  4. How do I get out of the current multiple nested loops in JAVA?
  5. Can a switch statement work on byte, long, or String?
  6. short s1 = 1; s1 = s1 + 1; What’s wrong with that? short s1 = 1; s1 += 1; What’s wrong with that?
  7. Can a char variable hold a Chinese character? Why is that?
  8. What’s the most efficient way to figure out 2 times 8?
  9. Please design a 10 billion calculator
  10. When you modify a variable with the final keyword, is the reference immutable or the referenced object immutable?
  11. What exactly is the difference between “==” and equals?
  12. What’s the difference between a static variable and an instance variable?
  13. Can calls to non-static methods be made from within a static method?
  14. The difference between Integer and int
  15. Math.round(11.5) equals what? What is math.round (-11.5)?
  16. What’s wrong with the following code?
  17. Name the difference between the public, private, protected, and non-write scopes
  18. The difference between Overload and Override. Can the Overloaded method change the type of the return value?
  19. Can the Constructor be override?
  20. Is the interface inheritable? Does an abstract class implement an interface? Can an abstract class inherit a Concrete class? Can an abstract class have a static main method?
  21. When writing the clone() method, there is usually one line of code. What is it?
  22. What are the aspects of object-oriented characteristics
  23. What is the mechanism for implementing polymorphism in Java?
  24. What is the difference between abstract class and interface?
  25. Can abstract method be static, native, and synchronized?
  26. What is an inner class? The difference between Static Class and Inner Class.
  27. Can an inner class reference a member of its containing class? Are there any restrictions?
  28. Does Anonymous Inner Class extends(extends) other classes and implements interface(implements)?
  29. Super.getclass () method call
  30. Is String the most basic data type?
  31. String s = “Hello”; s = s + ” world!” ; Did the contents of the original String change after these two lines of code were executed?
  32. Can I inherit from the String class?
  33. String s = new String(“xyz”); How many String objects are created? What’s the difference between the two?
  34. The difference between String and StringBuffer
  35. How do I convert a comma-separated string into an array?
  36. Does an array have a length() method? Does String have a length() method?
  37. String s=”a”+”b”+”c”+”d”;
  38. If there is a return statement in the try {}, will the code in finally {} immediately following the try be executed and when, before or after the return?
  39. What is the output of the following program code?
  40. Final, finally, Finalize.
  41. How are run-time exceptions different from normal exceptions?
  42. What is the difference between Error and exception?
  43. The simple principle and application of exception handling mechanism in Java.
  44. Write the five runtime exceptions that you see most often.
  45. Key words: how the JAVA language exception handling, throws, throw, the try, catch, finally respectively represent what meaning? Can an exception be thrown in a try block?
  46. How many ways can you implement a thread in Java? What keywords are used to modify synchronization methods? Why are the stop() and suspend() methods not recommended?
  47. What is the difference between sleep() and wait()?
  48. What are the similarities and differences between synchronous and asynchronous, and when are they used separately? Give an example.
  49. Are the following two methods synchronized? (Own invention)
  50. How many ways can multithreading be implemented? How many ways can synchronization be implemented?
  51. Do I start a thread with run() or start()?
  52. When a thread accesses a synchronized method of an object, can other threads access other synchronized methods of the object?
  53. Basic concepts of threads, basic states of threads, and relationships between states
  54. Briefly synchronized and Java. Util. Concurrent. The locks. The similarities and differences between the Lock?
  55. Design four threads, two of which increase j by 1 each time, and two of which decrease j by 1 each time. Write the program.
  56. The child loop 10 times, and then the main loop 100, and then back to the child loop 10 times, and then back to the main loop 100, and so on for 50 times, write a program.
  57. This section describes the structure of the Collection framework
  58. What interface does Collection framework implement comparison
  59. Difference between an ArrayList and a Vector
  60. Difference between HashMap and Hashtable
  61. What’s the difference between a List and a Map?
  62. Do List, Set, Map inherit from the Collection interface?
  63. What are the features of the List, Map, and Set interfaces when accessing elements?
  64. Name storage performance and features for ArrayList,Vector, LinkedList
  65. Remove duplicate elements from a Vector
  66. The difference between Collections and Collections.
  67. Elements in a Set cannot be repeated, so what is the way to distinguish between repeated and not? Equals == or equals()? What’s the difference?
  68. What collection classes do you know? The main method?
  69. Two objects with the same value (x.equals(y) == true) can have different hash codes.
  70. If the TreeSet contains both the parent and subclass instances of the TreeSet, use the parent’s compareTo method or use the subclass’s compareTo method.
  71. Name five common classes, packages, and interfaces
  72. How many types of flows are there in Java? The JDK provides some abstract classes for each type of stream to inherit from. What are they?
  73. The difference between a byte stream and a character stream
  74. What is Java serialization and how is it implemented? Or explain the role of the Serializable interface.
  75. Describe how the JVM loads class files.
  76. What’s the difference between heap and stack?
  77. What is GC? Why GC?
  78. Advantages and principles of garbage collection. Two recycling mechanisms are considered.
  79. What is the rationale behind the garbage collector? Can the garbage collector reclaim memory right away? Is there any way to proactively notify the virtual machine for garbage collection?
  80. When to use Assert.
  81. Is there a memory leak in Java? Please describe it briefly.
  82. Can you write your own class, also called java.lang.string?
  83. Java code check error

Algorithm and programming

  1. Write a program to alternately merge the words in the A.txt file and the words in the B.txt file into the C.txt file. The words in the A.txt file are separated by carriage return characters, and the words in the B.txt file are separated by carriage return or Spaces.
  2. Write a program to copy all the. Java files in the d:\ Java directory to the D :\jad directory and change the extension of the original file from. Java to.
  3. Write a function that intercepts a string. The input is a string and the number of bytes, and the output is a string cut by bytes, but to ensure that the Chinese characters are not cut in half, such as “I ABC”, 4, should intercept “I AB”, input “I ABC han DEF”, 6, should output “I ABC”, not “I ABC+ han half”.
  4. There is a string that contains Chinese characters, English characters, and numeric characters. Please count and print the number of each character.
  5. Illustrate the binary tree encountered in life, using Java to achieve binary tree
  6. Read all the names from a text file like the following and print out the repeated names and the number of times they are repeated, sorted by the number of times they are repeated:
  7. Write a Singleton out.
  8. Recursion algorithm number one
  9. Recursive algorithm number two
  10. What are the methods of sorting? Please list. Use JAVA to implement a quicksort.
  11. There is the array A [n], which is reversed in Java code
  12. Amount conversion, the amount of Arabic numerals into the traditional Chinese form such as :(¥1011) -> (one thousand one one yuan only) output.

Html&JavaScript & Ajax part

  1. Judge that the second date is larger than the first date
  2. Use table to display n records, changing color every 3 rows, namely 1,2,3 with red font, 4,5,6 with green font, 7,8,9 with red font.
  3. How do I verify that the contents of a numeric text box are all numbers before submitting an HTML form? Otherwise, prompt the user and terminate the submission?
  4. Write javascript code that validates all numeric input in an HTML text box
  5. Tell me what Ajax technologies and frameworks you’ve used, and what the differences are

Iv. Java Web part

  1. Tomcat optimization experience
  2. The differences between GET and POST for HTTP requests
  3. Explain what a servlet is
  4. What about the life cycle of servlets?
  5. The basic architecture of servlets
  6. What is the difference between forward() and redirect() in the SERVLET API?
  7. When do YOU call doGet() and doPost()?
  8. The main methods of the Request object are:
  9. The difference between forward and redirect
  10. What is the difference between request.getAttribute() and request.getParameter()?
  11. What built-in objects does JSP have? What are the effects? What are the methods?
  12. What actions does a JSP have? What are the effects?
  13. JSP common instructions
  14. JSP dynamic INCLUDE and static INCLUDE difference?
  15. What are the two ways to jump? What’s the difference?
  16. Method of object passing between pages
  17. What are the similarities and differences between JSPS and servlets, and what is the connection between them?
  18. What technologies are there to implement the various parts of MVC? How to do that?
  19. In the process of web application development, we often encounter the output of a certain code character, such as ISO8859-1, etc. How to output a certain code string?
  20. Now enter n numbers, separated by commas; Then you can choose ascending or descending sort; Pressing the Submit button will show you what sort on another page, and the result will be “Reset”

5. Database

  1. List each employee by department number, from highest to lowest, and from lowest to highest salary in two ways.
  2. List the number and department numbers of employees in each department whose salaries are higher than the average salary of the department and sort them by department number
  3. Stored procedures and triggers must be talked about, often interviewed?
  4. What are the database three paradigms?
  5. What is your database optimization experience?
  6. What’s the difference between union and union all?
  7. Paging statement
  8. Use an SQL statement to query the names of students whose scores are greater than 80 for each course
  9. A combination of competitions between all departments
  10. Each month has more money than 101 subjects
  11. Collect monthly statistics for each year
  12. Display the title of the article, who posted it, and last reply time
  13. Delete redundant student information that is identical except for different id numbers
  14. Some flight queries in the airline network:
  15. Find out who gets paid more than the manager:
  16. Find the number of students older than 12 taught by each teacher under the age of 45
  17. Find out who posted the most:
  18. There is a score field in a user table. If there are more than 1 million users in the database, what would you consider and how would you solve the problem if you wanted to clear your score at midnight on the first day of every year?
  19. A user has multiple roles. Query other users in the table that have all the roles of the user.
  20. SQL interview in XXX company
  21. There are three ways to register Jdbc drivers
  22. How do I call stored procedures with JDBC
  23. Benefits of preparedStatements compared to Statements in JDBC
  24. Write code to connect to and access Oracle data using JDBC
  25. What does Class. ForName do? Why?
  26. Paging solution under large data volume.
  27. Use JDBC to query student transcripts, write out the main code (exam probability is great)
  28. What’s wrong with this code?
  29. What is the working mechanism of data connection pooling?
  30. Why ORM? How is it different from JDBC?

Vi. XML part

  1. What are the parsing techniques for XML? What’s the difference?
  2. What aspects of XML technology did you use in your project? How is it done?
  3. How to solve Chinese problems when parsing XML files with JDOM? How to parse?
  4. Programming the way JAVA parses XML
  5. How many forms does an XML document definition take? What are the essential differences between them? What are some ways to parse AN XML document?

7. Popular frameworks and new technologies

  1. Talk about your understanding of Struts.
  2. Talk about your understanding of Hibernate
  3. The role of AOP.
  4. Your understanding of Spring.
  5. Talk about Action servlets in Struts.
  6. Struts advantages and disadvantages: 1. MVC mode, clear structure, so that developers only focus on the implementation of business logic
  7. STRUTS application (e.g. STRUTS architecture)
  8. Tell us the difference between struts1 and struts2.
  9. Hibernate update() vs. saveOrUpdate() vs. Session Load () vs. Get ().
  10. What are the advantages and disadvantages of Hibernate and JDBC? How to write a One to Many configuration file.
  11. How is iBatis different from Hibernate?
  12. Orm configuration to write Hibernate one-to-many and many-to-one bidirectional associations?
  13. How are DAO design patterns embodied in DAOs?
  14. How to configure spring+Hibernate delegate scheme?
  15. How to configure spring+Hibernate delegate scheme?
  16. Hibernate takes several fields from each table in a multi-table query, that is to say, there is no entity class corresponding to the query result set.
  17. Introduce Hibernate’s second-level cache
  18. What does Spring mean by dependency injection? How to write an XML configuration file for a Bean whose message property, of type string, is injected with the value “Hello”?
  19. What is Jdo?
  20. What is IOC AOP for Spring
  21. STRUTS workflow!
  22. The difference between Spring and EJB!!
  23. What does Hibernate’s Inverse property do?

Software engineering and design patterns

  1. UML has
  2. Common J2EE design patterns? Illustrate the factory mode.
  3. What design patterns were used in the development? For what occasion?

Ix. J2ee part

  1. The relation and difference between BS and CS.
  2. What is the difference between an application SERVER and a WEB SERVER?
  3. What does the application server have?
  4. What is J2EE?
  5. Is J2EE a technology, platform or framework? What is the J2EE
  6. Explain (or simply describe) the following common terms used in J2EE
  7. How do I specify the size of memory for WebLogic?
  8. How to set weblogic hot start mode (development mode) and product release mode?
  9. How can I boot without entering a user name and password?
  10. In the WebLogic management console, the JMS and EJB or connection pool configurations for an application Domain (or a website,Domain) are actually saved in what file?
  11. What is the default directory structure for a Domain in WebLogic? For example, to put a simple helloworld.jsp in a directory, but in the browser can be http:// host: port number //helloword.jsp can see the result? For example, this one uses a javaBean written by myself how to do?
  12. What configuration files are involved in publishing EJBs in WebLogic
  13. How to configure SSL in WebLogic and client authentication configuration or say J2EE (standard) for SSL configuration?
  14. How do I view EJBs that have been published in WebLogic?

X. EBJ part

  1. What technologies are EJB implementations based on? And tell the difference between SessionBean and EntityBean, StatefulBean and StatelessBean.
  2. What are the seven Transaction levels of EJB?
  3. What is the difference between EJBs and JAVA Beans?
  4. EJB including (session beans, EntityBeans) say their life cycle, and how to manage transactions?
  5. Services provided by the EJB container
  6. EJB activation mechanism
  7. Several types of EJBs
  8. A few basic steps for the customer side to invoke an EJB object

11. Webservice

  1. WEB SERVICE noun description. Introduction to the JSWDL development kit. JAXP, JAXM interpretation. SOAP, UDDI,WSDL interpretation.
  2. What is CORBA? What is it for?
  3. Linux
  4. LINUX thread, GDI class explanation.
  5. It’s a very confusing question
  6. Four session tracking techniques
  7. Description logic operation (&, |, ^) and operating conditions, &&, | |).

Xii. Miscellaneous

  1. Please introduce yourself briefly in English
  2. Please translate this paragraph from tomcat.apache.org/ into Chinese.

conclusion

When answering the questions, first answer what it is, then answer what it does and what to pay attention to (this part is the most important, show your experience).

It is very important to have separate paragraphs, clear layers and clear order in the answer. These superficial things can also reveal a person’s habits, style and organization.

Write down the thought process that you went through to get the answer, or the idea that you remembered the answer. Think of it as a debating contest. The answer is to reason with others and present facts. The answer is not limited to what format and form, is to show their knowledge!

Don’t be afraid to answer because someone else’s question is ambiguous. You should be bold to point out that the other subject is very vague and your point of view, do not think of the interviewer how high, in fact, he and you are about the same, you think, if he recruited you, you will be colleagues, is not about the same?

Interview questions and answers PDF latest 2021 organized collection of some high frequency interview questions (all organized into a document), there are many dry things, including mysql, Netty, Spring, threading, Spring Cloud, JVM, source code, algorithm, etc., there are also detailed learning plans, interview questions organized into a PDF