Java programmer interview 32 questions

xiaoxiao2021-03-06  21

First, talk about the difference between Final, Finally, Finalize.

Second, anonymous inner class (anonymous internal class) can be extends other classes, can IMPLEMENTS INTERFACE (interface)?

Third, Static Nested Class and Inner Class are different, the more you say, the better (the interview question is very general).

The difference between fourth, & and &&.

Fifth, the difference between HashMap and HashTable.

Sixth, the difference between Collection and Collectes.

Seventh, when do you use Assert.

Eighth, what is GC? Why do you have GC?

Ninth, string s = new string ("xyz"); created a few String Object?

Tenth, Math.Round (11.5) Is it equal? How much is Math.Round (-11.5)?

In the eleventh, short s1 = 1; S1 = S1 1; What is wrong? Short S1 = 1; S1 = 1; What is wrong?

12. What is the difference between SLEEP () and WAIT ()?

Thirteenth, have Java goto?

Fourteenth, there is a length () method for arrays? STRING has a length () method?

Fifteenth, the difference between overload and override. Can OVERLOADED methods change the type of return value?

The elements in the SET are not repeated, then what method is used to distinguish whether it is repeated? Is it == or equals ()? What is the difference?

Seventest, give me a Runtime Exception you most often.

Eighteenth, what is the difference between ERROR and EXCEPTION?

Near 10th, List, SET, MAP inherits from a Collection interface?

Ten, what is the difference between Abstract Class and Interface?

Second Eleventh, abstract can be static at the same time, whether it can be native at the same time, is it SYNCHRONIZED?

Typographic, can the interface inherit the interface? Is the abstract class implement (imports) interface? Does abstract classes inherit the physical class (CONCRETE CLASS)?

On the thirteenth, starting a thread is Run () or start ()?

24. Is the constructor CONSTRUCTOR can be Override?

The second fifteenth, can you inherit the String class? Twentydays, after a thread enters an SYNCHRONIZED method of an object, can other threads can enter other methods of this object?

27. There is a Return statement in try {}, then the code in finally {} in this try will not be executed, when is executed, before returnome or after?

Chapter 28. Program: 2 Multiply 8 equal to?

The second nine, the two object values ​​are the same (x.equals (y) == true, but there can be different haveh codes, this sentence is wrong?

Thirty, when an object is passed as a parameter to a method, this method can change the properties of this object and return the resulting result, then here is the value delivery or reference delivery?

Thirty-first, whether SWTICH can act on byte, whether it can act on long, can it work on String?

Article 32. Program: Write a Singleton.

转载请注明原文地址:https://www.9cbs.com/read-48591.html

New Post(0)