Discover java performance tuning interview questions, include the articles, news, trends, analysis and practical advice about java performance tuning interview questions on alibabacloud.com
distributed RESTful Service video tutorial First set:billions of traffic e-Commerce Details page System combat-cache Architecture + high-Availability service architecture + MicroServices Architecture (first edition)Second set:billions of traffic e-Commerce Details page System combat-cache Architecture + high-Availability service architecture + MicroServices Architecture (second edition)The third set:Elaticsearch Video Two sets-full version (core and advanced step)Elasticsearch Top Master Series
I. Application of the factory model in development
Interview Questions:Write a simple calculator.
Code implementation:
Abstract An operation class:
Package COM. qianyan. calcuator; public abstract class operation {// number one private double num1; // number two private double num2; Public double getnum1 () {return num1;} public void setnum1 (double num1) {This. num1 = num1;} public double getnum2 () {return num2;} public void setnum2 (double num2)
only be performed through the defined interface. Object-oriented computing begins with the basic concept that the real world can be depicted as a series of completely autonomous and encapsulated objects that access other objects through a protected interface.4. Polymorphism:Polymorphism allows different types of objects to respond to the same message. Polymorphism includes parameterized polymorphism and inclusion polymorphism. Polymorphism language is flexible, abstract, behavior sharing, codeB
)
71. What are the similarities and differences between synchronized and java. util. concurrent. locks. Lock?The main point is that Lock can complete all functions implemented by synchronized.
Major difference: Lock has more precise thread semantics and better performance than synchronized. Synchronized Automatically releases the Lock, which must be manually released by the programmer and must be released i
difference between the 5.sendRedirect () and Forward () methods?The Sendredirect () method creates a new request, and the forward () method simply forwards the request to a new target. After redirection (redirect), objects that were within the scope of the previous request are invalidated because a new request is generated, and after forwarding (forwarding), objects within the scope range of the previous request can be accessed. Sendredirect () is generally considered to be slower than forward
Key factors that affect Java performance
1 hardware configuration, such as CPU, memory, server architecture, etc. 2) operating system 3) database system and database server 4 JVM 5 Application Server 6 The impact of network Environment 7) system architecture and code writing follow the specification for performance tuning
the value assigned to the variable is immutable, that is, it is a constant. If final modifies an object, it indicatesThe reference assigned to this variable is immutable,What cannot be changed is the reference saved by this variable, and it is not the object pointed to by this reference. In the second case, final has the same meaning as in the first case. ActualFor the first two cases, there is a more appropriate description of the meaning of final, that is, if a variable or method parameter is
, two string objects are created during the runB. Two objects are created during the runC. Create a String object during run timeD, create an object during run
66.
String str1 = "ABC";
String str2 = "A" + New String ("BC");
System.out.println ("STR1==STR2:" + (STR1==STR2));
67.synchronized and read-write locks are different. Read and Write locks why performance is a bit higher. I was told it was wrong to read it without locking it.68. What is the fra
The dashed box represents the interface, the solid wireframe represents the entity class, The thick wireframe represents the most commonly used entity classes, the dashed arrows indicate the implementation of the interface, and the implementation arrows indicate that the class can make objects of the class that the arrows refer to.
Collection: Allows only one object to be placed in each location. It includes a list of "holding a set of objects in a certain order", and a set that "only allo
: Checking URLsCompression: Boot compressioncompressionminsize:2048 when the return content is greater than or equal to 2kb boot compression, to the client in the decompressionCompressablemimetype: Compression typeIi. springboot Item 1, JVM parametersSpringboot starts directly with the jar package and adds parameters to the start command, here is an example:nohup java -server -Xms4096m -Xmx4096m -Xmn1024m -Xss256K -XX:+DisableExplicitGC -XX:MaxTenurin
The JVM is the heavy load machine behind Java features and performance, which most developers take for granted. However, few of us understand how the JVM works-like task assignments and garbage collection, turning threads, opening and closing files, interrupting and/or JIT compiling Java bytecode, and so on.
Not being familiar with the JVM will not only affect a
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.