[Reprint] Java interview questions

Source: Internet
Author: User
First, let's talk about the differences between final, finally, and finalize.

Most often asked.

Second, can anonymous inner class (anonymous internal class) be extends (inherited) other classes, or implements (implemented) interface (Interface )?

Third, the difference between static nested class and inner class is that the more you say, the better (the more general the interview questions are ).

Fourth, the difference between & and.

This is rarely asked.

Fifth, the difference between hashmap and hashtable.

Frequently Asked.

Sixth, the difference between collection and collections.

You must never say that one is singular or multiple.

7. When to use assert.

API-level technical personnel may ask this question.

Eighth, what is GC? Why does GC exist?

Basic.

Ninth, string S = new string ("XYZ"); how many string objects are created?

10. How much is math. Round (11.5? Math. Round (-11.5) and so on?

11th, short S1 = 1; S1 = S1 + 1; what is the error? Short S1 = 1; S1 + = 1; what is the error?

All interview questions are abnormal and we need to prepare for abuse.

12th. What is the difference between sleep () and wait?

Thread favorites.

13th. Does Java have a goto?

Very 13 questions. If any interview asks this question, I suggest you stay away from the company.

14th, does the array have the length () method? Does string have the length () method?

15th, the difference between overload and override. Can the overloaded method change the type of the returned value?

Frequently Asked.

16th. The elements in the set cannot be repeated. How can we identify whether the elements are repeated or not? Is = or equals () used ()? What are their differences?

17th. Give me the most common runtime exception.

If you cannot answer this question, the interviewer will think that you have no practical programming experience.

18th, what is the difference between error and exception?

19th, list, set, and map are inherited from the collection interface?

20th. What is the difference between abstract class and interface?
Frequently Asked.

21st can abstract methods be both static, native, and synchronized?

22nd. Can an interface inherit an interface? Can an abstract class implement the (implements) interface? Can an abstract class inherit a concrete class )?

23rd. Is run () or start () used to start a thread ()?

24th. Can constructor be overwritten?

25th. Can I inherit the string class?

26th. After a thread enters a synchronized method of an object, can other threads access other methods of this object?

27th, there is a return statement in try {}, so will the code in finally {} following this try be executed? When will it be executed, before or after return?

28th. Programming question: how many equals 2x8 in the most efficient way?
Programmers with a C background are particularly fond of asking such questions.

29th, the two objects have the same value (X. Equals (y) = true), but different hash codes are available, right?

30th. After an object is passed as a parameter to a method, this method can change the attributes of the object and return the changed result, so is it a value transfer or a reference transfer?

31st. Does swtich work on byte, long, and string?

32nd programming question: Write a singleton

Add your own problems:
CA people asked me about the SWT differences in the swing design model.
Directory structure of the war package. the most basic elements of configuring servlet in Web. xml
Use of Guan jianzi volatile and transient
Use datainputstream and inputstream as writeint

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.