Java three years experience-Interview summary

Source: Internet
Author: User

A round of interviews, from the initial self-confidence can do anything, to now feel nothing to do, but the face of the interviewer, but more calm.

You can still remember the face of the question, a little tidy up. Please correct me.

Private, default, protected, public scope
1) Private, homogeneous
2) default, homogeneous, same package
3) protected, homogeneous, same package, sub-category
4) Public, all

How String Trim is implemented
Remove the trailing ASCII value less than ' (space) characters

StringBuffer, StringBuilder difference
StringBuffer Thread Safety
StringBuilder thread is not secure

Similarities and differences of abstract classes and interfaces
Same: With abstract methods
XOR: 1) Abstract classes can have constructors, non-abstract methods, non-public properties, and can only inherit abstract classes
2) interface with only public abstract methods or public static constants, can implement multiple interfaces at the same time
Personal experience: general use of abstract classes in the control layer, extraction of public initialization methods, framework customization tool methods, etc.
Interfaces are typically used at the business level

List, Set, collections differences
1) List, ordered and repeatable
2) Set, unordered does not repeat
3) Collections, Collection Tool class

Enumerating Key-value containers
1) HashMap, implementing map, asynchronous
2) Hashtable, implement map, and inherit old dictionary class, synchronize
3) Properties,hashtable sub-class, System parameters

Algorithm: Quick Sort

Inner JOIN, left JOIN, right join difference
1) inner JOIN, two table field values are the same
2) left JOIN, the two table field values are the same, and the table field has a value, the Right table field value is null
3) Right join, opposite to upper

Questions that need to be written in SQL
Usually let the detected value is the maximum, use the subquery, group functions, etc.
Reads (ID, IP, CNT) IP is not unique, detect the top 10 most visited IP and sort
Select R.ip, R.S, rownum from (select IP, SUM (CNT) s from reads group by IP order by s) R where R.rownum <= 10

Database Performance Tuning
1) Create a sequence of fields that often make query conditions
2) When associating a query, associate a result set, instead of directly associating an entire table, or using exists

JSP form JS Check
var name = document.getElementById (' UserName '). Value;
if (name = = ")
{
Alert (' User name cannot be null ');
return false;
}

Is the action of struts a single case?
1) Struts1 action is a singleton and thread-safe
2) The action of Struts2 is not a singleton and produces an instance for each request

The difference between hibernate and MyBatis
1) Hibernate, using Pojo to achieve ORM, query speed compared to slow, insert/update development Easy
2) mybaits, using pure SQL development, execution efficiency is faster, more suitable for statistics, multi-table association query

Hibernate status
Transient state: New Object
Persistent state: the instance corresponds to a record in the database and has a persistent identity
Free State: Session closed, session open, Free State turned into persistent state

The difference between # and $ in Ibatis
1) #, variable substitution, that is, preparestament sets the field value and can match the variable type
2) $, string stitching, requires careful dependency injection

Transaction characteristics
1) atomicity: A lot of operations are either done or not done at all
2) Consistency: Transactional execution Results change the database from one consistent state to another
3) Isolation: Transaction execution is not affected by other transactions
4) Persistence: Once submitted, changes to the database are permanent

The difference between spring MVC and STRUTS2
1) struts2 package display layer and control layer, presentation layer provides tag library and validator, request and answer need configuration file
2) Spring MVC is a simple control layer frame, the URL realizes zero configuration, the operation efficiency is improved.

Spring IOC Injection method
1) configuration file, configure properties, provide Setter/getter method
2) 0 configuration, @Autowired, unified configuration injection by name or type

Spring AOP Ideas
Uniform preprocessing for requests, such as validation, or post-processing, such as record processing results; For method plus before or after processing

Spring Transaction Configuration
1) Use Tx:advice, for business interface layer, such as do, get and so on named method, for transaction configuration

WebService Technology
1) axis, Xfire, CXF, soap-based, transfer XML
2) RESTful style

JVM Performance Tuning
Tomcat Performance Tuning

Java three years experience-Interview summary

Related Article

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.