1) is transient and volatile a Java keyword? (Instant connection)
A: Yes, but I have never used it. I checked it online. Transient is used for synchronization or not. Used for fields. Fields are not part of the object's persistent State and should not be concatenated with the object.
Volatile is almost useless. Is used inside the VM. The function is that when a class or interface is defined as volatile, the virtual machine will automatically process the operation and the result will not be determined. However, if the keyword is added, the virtual machine will execute it according to the specification.
2) What is the difference between an abstract class and an interface? (Instant connection)
Answer: omitted
3) Can I talk about the Java reflection mechanism? (Instant connection)
A: Reflection mechanisms have been widely asked during Java interviews. Whether it is used in your project or not. You can evaluate your abilities and knowledge.
Give an example to illustrate everything!
Import java. Lang. Reflect. method;
Public class util {
// The biggest advantage of this method is that there is no class name son1, and son2 can be specified through parameters, so there is no need to appear in the program
Public static base convertstr2servicebean (string beanname, string fieldsetter, string paravalue ){
Base base = NULL;
Try {
Class CLS = Class. forname (beanname );
Base = (base) CLS. newinstance ();
Class [] paratypes = new class [] {string. Class };
Method method = Cls. getmethod (fieldsetter, paratypes );
String [] paravalues = new string [] {paravalue };
Method. Invoke (base, paravalues );
} Catch (throwable e ){
System. Err. println (E );
}
Return base;
}
Public static void main (string [] ARGs ){
Son1 son1 = (son1) util. convertstr2servicebean ("trying. Reflect. son1", "setname", "Wang Da Sha ");
System. Out. println ("son1.getname ():" + son1.getname ());
}
}
4) how to implement multithreading in Java? (Instant connection)
Answer: omitted
5) which design mode have you used? (Instant connection, IBM, AspenTech)
Answer: omitted
6) Let's Talk About the MVC Architecture (transient connection, IBM, AspenTech)
Answer: omitted
7) if Class A inherits Class B and implements Interface C, and Class B and Interface C define variables with the same name, what will happen? (Instant connection)
Answer: omitted
8) Why should I introduce internal classes in Java? Is there an anonymous internal class? (Instant connection, IBM)
Answer: omitted
9) What is the difference between final, finally, and finalize? (Instant connection)
Answer: omitted
10) Let's talk about the basic HTTP request process (IBM)
A: see http://blog.csdn.net/beijibingshan/archive/2007/06/15/1653666.aspx.
When you click a connection, the browser first finds the IP address of the site, which is achieved through DNS. After finding the IP address, you can establish a TCP connection. After the connection is established, we can send a request. The request contains the request content, server directory, and request file.
11) Is there a memory leakage problem in Java? For example? (IBM)
A: Memory leakage occurs.
12) Let's Talk About the algorithms used by the memory reclaim mechanism in Java (IBM, transient)
Answer: omitted
13) Let's talk about the functions of the system. GC () function. When can I call the garbage collector? (Instant connection)
Answer: omitted
14) What security authentication mechanism have you used in your project? (IBM)
A: No! The security authentication mechanism can be applied in a few projects, such as email sending and firewall control.
15) What is the role of math. Round?
Answer: The rounding function is provided.