Hua sai interview questions

Source: Internet
Author: User

1. What are the basic features of object orientation?
2. What is the difference between rewriting and overloading? (Important) when should I rewrite or reload it?
3. Struts Workflow
4. What is the difference between list and set? Why design these two interfaces? Arraylist hashset rule list treeset
5. How to capture exception categories?
6. How does a deadlock occur due to the multithreading problem (Key Point?
7. Talk about the reflection mechanism?
8. Design Questions:
The elevator is divided into the inside and outside of the elevator. The elevator can only be opened outside, and can be opened inside, closed, and a program is designed. If the elevator is on the 4th floor, press the elevator to the 8th floor, run up. After you press the close button, you cannot open the door outside the elevator. If someone opens the door on the first floor, the elevator cannot run down immediately, you must wait until the floor under the button inside the elevator can run down. If someone opens the door at the button outside the elevator on the 10th floor, then the elevator must run on the 10th floor to open the door before it can run down to the 1st floor and then open the door. Please design this program.
9. Equals and hashcode Methods
10. What should I pay attention to when rewriting the equals method? (Never heard)
11. Run the program. What is the result?
Public static void main (string [] ARGs ){
Stringbuffer x = new stringbuffer ("");
Stringbuffer y = new stringbuffer ("B ");
Methoda (x, y );
System. Out. println (x + "," + y );
}

Static stringbuffer methoda (stringbuffer S1, stringbuffer S2 ){
Return s1.append (S2 );
}
12. Program questions
Public static void main (string [] ARGs ){
Collection [] C = new collection [] {New arraylist (), new hashset (), new vector ()};
For (INT I = 0; I <C. length; I ++ ){
System. Out. println (getstring (C [I]);
}
}

Static string getstring (list ){
Return "list ";
}

Static string getstring (set list ){
Return "set ";
}

Static string getstring (collection list ){
Return "Collection ";
}

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.