Chapter 1 Basic Concepts of Java
- Advantages of the Java language?
- What is a Java Virtual machine? Why is Java called a “platform independent programming language”?
- What is the difference between Java and C++?
- What is the difference between the JDK and the JRE?
- What data types are supported by Java? What is automatic unboxing?
- What are value passing and reference passing?
- Can a”.java” source file contain multiple classes (not inner classes)? What are the restrictions?
- What’s the difference between a static variable and an instance variable?
- Is it possible to create objects without using constructors?
- What’s the difference between a static variable and an instance variable?
- Can calls to non-static methods be made from within a static method?
- How to implement object cloning?
- Can a.java source file contain multiple classes (not inner classes)? What are the restrictions?
- Can Anonymous Inner classes inherit from other classes? Can interfaces be implemented?
- Can an inner class reference a member of its containing class (the outer class)? Are there any restrictions?
- List your favorite JDK packages
- What are the differences between JDK, JRE and JVM?
Chapter 2 object – oriented programming
- What do we mean by Overriding and Overloading methods in Java?
- What is the difference between Overload and Override? Can the Overloaded method change the type of the return value?
- What is a constructor in Java? What is constructor overloading? What is a copy constructor?
- Can the Constructor be Override?
- Does Java support multiple inheritance?
- What is the difference between interfaces and abstract classes?
- The following statements are true.
- Java interface modifiers can be?
- Below are the definitions and constructors for the People and Child classes, each of which outputs a number. Which constructors are called sequentially when executing new Chil d(” Mike “)? Select the output result
- Can the constructor be overridden?
- Two objects with the same value (x.equals(y) == true) can have different hash codes.
- Does an interface extend an interface? Does an abstract class implement an interface? Can an abstract class inherit a Concrete class?
- Indicate the result of the following program:
- Class.forname (String className) What this method does
- What is AOP and OOP, and what is the difference between IOC and DI?
- Determine whether the following statements are correct and if there is an error, please indicate the error.
Chapter 3 Keywords
- What does the keyword “static” mean? Can I override a private or static method in Java?
- Can non-static variables be accessed in a static environment?
- What are the differences between access modifiers public, private, protected, and do not write (default)?
- Does the volatile keyword keep threads safe?
- Does Java have a Goto?
- What are the uses of the final keyword in Java?
- When do you use assert?
- Final, finally, Finalize?
Chapter 4 basic types and operations
- Tell me the difference between & and &&.
- What’s the most efficient way to figure out 2 times 8?
- Is there a number where I + 1 is less than I?
- The data type of 0.6332 is ().
- System.out.println(“5” + 2); The output should be ().
- What does the following method return when the input is 2?
- Float f = 3.4; Is that correct?
- What’s the difference between int and Integer?
- Can a char variable hold a Chinese character? Why is that?
- Math.round(11.5) equals what? What is math.round (-11.5)?
Chapter 5 strings and Arrays
- The following program results in ()
- The result of running the following code is?
- Is String the most basic data type?
- Does an array have a length() method? Does String have a length() method?
- Can I inherit from the String class?
- What’s the difference between String and StringBuilder?
- String s = new String (” xyz “); How many string objects are created?
- Converts the character “12345” to long
- To display a result like myStr = 23, write out the command you type on the console
- String s = “Hello”; S = s + “world!” ; Did the contents of the original String change after these two lines of code were executed?
- How do I convert a comma-separated string into an array?
- String s= “a” + “b” + “c” + “d”;
- What’s the difference between String and StringBuffer?
- StringBuffer StringBuilder.
Chapter 6 input and output streams
- Which of the following stream classes is a character-oriented input stream?
- Read the definitions of Shape and Circle. When serializing a Circle object Circle into a file, which of the following fields is saved in the file?
- What is Java serialization and how is it implemented?
Chapter 7 collection classes
- The following statement is true.
- ArrayList list = new ArrayList(20); How many times does the list expand in?
- What are the basic interfaces of the Java Collection Class framework?
- Why do collection classes not implement Cloneable and Serializable interfaces?
- What is an Iterator?
- What is the difference between Iterator and ListIterator?
- What is the difference between fail-fast and fail-safe?
- How does a HashMap in Java work?
- Where are the hashCode() and equals() methods important?
- What is the difference between HashMap and Hashtable?
- What’s the difference between an Array and an ArrayList? When should you use Array instead of ArrayList?
- What’s the difference between ArrayList and LinkedList?
- What are the Comparable and Comparator interfaces for? List the differences.
- What are the best practices for Java collection class frameworks?
- What are the differences between the Enumeration interface and the Iterator interface?
- What’s the difference between HashSet and TreeSet?
- Do List, Set, and Map inherit from the Collection interface?
- Name storage performance and features of ArrayList, Vector, LinkedList.
- What are the features of the List, Map, and Set interfaces for storing elements?
- Determine whether the following statements are correct and if there is an error, please indicate the error.
- How do you understand Java generics?
Chapter 8: The Java platform and memory management
- Is the GC thread a daemon thread? (a)
- Explains the use of stack, heap, and static storage areas in memory.
- Is there a memory leak in Java? Please describe it briefly.
- What is GC? Why GC?
- At what line does the object generated in line 3 become an object of garbage collection after execution?
- Describe how the JVM loads class files.
Chapter 9 Exception Handling
- The following statement about the java.lang.Exception class is correct ()
- Extension: The difference between errors and exceptions (Error vs Exception)
- The getCustomerInfo() method looks like this. There are three types of exceptions that can be caught in a try.
- 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?
- How to handle exceptions in Java language? How to use the keywords: throws, throws, try, catch, finally?
- What are the similarities and differences between runtime exceptions and checked exceptions?
- List five common Runtime exceptions.
- What is the difference between Error and exception?
Chapter 10 XML
- What interpretation techniques does XML include, and what are the differences?
- 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?
- Where did you use XML in your project?
- What is your understanding of XML? What is the function of the web. XML file in a Web application?
- XML is a meta-language that can be used to describe other languages.
- The symbol used for annotation in XML is. (Select 1)
- Both DTDS and XML Schemas are XML documents. (Select 1)
Chapter 11 Java multithreading
- Which of the following are methods of the Thread class?
- What is the result of the following program?
- What is the difference between a process and a thread?
- How many different ways can you create a thread? Which one do you prefer? Why is that?
- Briefly explain the available states of threads.
- What is the difference between a synchronized method and a synchronized code block?
- How is thread synchronization done inside a Monitor? What level of synchronization should the program do?
- What is a deadlock?
- How do I ensure that N threads can access N resources without causing deadlocks?
- What is the difference between sleep() and wait()?
- What’s the difference between sleep() and yield()?
- After one thread enters the synchronized method A of an object, can other threads enter the synchronized method of the object?
- Name a method related to thread synchronization.
- Synchronized?
- Examples of synchronous and asynchronous.
- Do I start a thread with the run() or start() method?
- What is a thread pool?
- The basic state of the thread and the relationship between the states?
- A necessary condition for deadlocks? How to overcome it?
Chapter 12 JDBC and Databases
- The following relational databases are ()
- What is the role of connection pooling in database programming?
- What is the DAO pattern?
- What is ORM?
- How do transactions work in JDBC?
- What does transaction ACID mean?
- How to improve the performance of reading data when using JDBC to operate a database? How to improve the performance of updated data?
- The difference between stored procedures and functions
- Do you think indexing tables can improve the efficiency of database systems? Why?
- What is database referential integrity?
- How to optimize database, how to improve database performance?
Chapter 13 servlets and JSPS
- What built-in objects and actions does a JSP have? What are their functions?
- Describe the differences, similarities, and scope of application between JSP and Servlet
- Which of the following options can be used to obtain the initialization parameters of the Servlet?
- Which object can be used to get the request sent by the browser?
- To run the JSP, you need to install _____Web server.
- In the network programming of the server, the methods to solve the session tracking are
- The methods associated with the HttpSessionListener interface are
- Which of the following is true about JSP lifecycle statements?
- Which of the following statements is true?
- Which of the following is an implied object for a JSP?
- Which of the following objects does not belong to the MVC pattern?
- The way the Servlet handles requests is. (Select 1)
- The javax.Servlet package, which belongs to the class. (Select 1)
- The default Http request method is. (Select 1)
- An object that implements which of the following interfaces does not require additional Settings in the web.xml file for the Servlet container to respond to events that occur when the object joins an HTTP session? (Select 1)
- Which of the following is the tag of a small script for JSP? (Select 1)
- The following are not standard directives for JSP. (Select 1)
- For a variable to be accessed by every web site visitor, it should be set to __________ variable. (Select 1)
- View the following JSP content
- Suppose a < JSP :useBean> element is set inside a.jsp :useBean
- In the MVC design pattern, the javabeans are. (Select 1)
Chapter 14 J2EE and EJB
- What is J2EE? What technologies does it include?
- Describes the multiple layers of the J2EE framework and briefly explains what each layer does.
- What are the three types of beans that an EJB contains
- What is the default port of the Tomcat server? How do I change the Tomcat port?
- What are the advantages of EJBs? (Select 2 items)
- Stateless session beans, stateful session beans, CMP, and BMP, which Bean does not need to write its own code to connect to the database?
- Assuming the web application’s document root is MyApp, where to find database.jar file 8. What are the minimum Java classes and interfaces that must be written to create an EJB?
- In which version of Java does the EJB class inventory reside? (Select 1).
- Components that belong to the Web layer in J2EE are (select 1)
- EJB roles and three objects
- EJB activation mechanism
- Several types of EJBs
Chapter 15 SSH Architecture
- Describe the Struts architecture? What are the main parts of the development work?
- How to combine Struts, Hibernate and Spring to develop Web applications?
- Describes the application of inversion control (IOC) and directional programming (AOP) in Spring
- This section describes the workflow of Web applications based on Struts
- What aspects of Spring have you used in your project? And what Ajax frameworks have you used?
- In MVC mode, M, V, C each represents the meaning, and briefly describes the expression of MVC in Struts.
- Java objects in Hibernate have several states, and how they relate to each other (distinguish and transition from one another).
- How to understand the lazy loading of Hibernate, and how to deal with the contradiction between lazy loading and session closing in practical applications?
- Which layer of MVC do actionforms and actions belong to in Struts1, and why?
- In Struts2, how does an Action get the data the user enters from the page, and how does it pass its own data to the view?
- What is factory mode?
- How is internationalization implemented in Struts and what files are involved?
- Which of the following programming languages does the Struts framework support? (Select 1)
- What is Struts?
- What is Spring?
- What is Hibernate?
- Briefly explain the struts2 execution process in your own words
Chapter 16 UML
- What is UML? What diagrams are there in UML?
- Class diagram is used to represent the system classes and the relationship between classes, it is the description of the dynamic structure of the system. (Select 1)
Chapter 17 common design patterns
- Write a singleton class.
- Describe design patterns that you are familiar with or have heard of and what you think of them.
- What design patterns do you use in your development? For what occasion?
- Programming problem: Write a Singleton
Write in the last
Java interview guide has been compiled, a total of 231 pages, collected more than 190 interview questions. Contains:
- Basic Java Concepts
- Object-oriented programming
- The keyword
- Basic types and operations
- Strings and Arrays
- Input-output stream
- Collection classes
- The Java platform and memory management
- Exception handling
- XML
- Java multi-thread
- JDBC and Databases
- The Servlet and JSP
- The J2EE and EJB
- SSH architecture
- UML
- Common Design Patterns
And so on knowledge points, now share its free to everyone!
Friends who need to pay attention to the public below can receive interview materials and video learning materials
Here are some screenshots from the article