Java trap and a basket --- top question set

zhaozj2021-02-16  73

Looking for a job to interview, there is an interview with a way to deal with the interview. Some of the following topics come from me and my friend's painful interview experience, including these issues include IBM, E * Trade, Siebel, Motorola, Sun, and other size companies.

There is no reason for the interview, and it is unreasonable, and it is out of practice. Have written on paper, there is a face test you, and there is also a question in the phone, giving you the estimate of the IDE, so you can buy a lottery ticket, maybe it is specified. So if you have finished reading this article, please don't complain that these problems can be solved with IDE. You have to answer these questions in any case, if you have one or two questions in the interview, you will be able to be rejected.

Of course, these are the basic questions of Java. Most people who have interviews will not ask you how Hibernate has more advanced, Eclipse's three components, or Command Design Pattern, they are all aged, and the favorite is basics. . Don't underestimate these foundations, my friend is first-class, and the results are planted under the basis of basics, and the high salary is not worthy.

It's better to say less nonsense and start the topic.

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

It is most often asked.

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 &&.

This is very small.

Fifth, the difference between HashMap and HashTable.

I often ask.

Sixth, the difference between Collection and Collectes.

Don't say one is a single one is a plural.

Seventh, when do you use Assert.

API-level technicians may ask this.

Eighth, what is GC? Why have GC?

basis.

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

Tenth, Math.Round (11.5) is equal to how much? Math.Round (-11.5) is equal?

Eleventh, short s1 = 1; S1 = S1 1; What is wrong? SHORT S1 = 1; S1 = 1; What is wrong?

The interview questions are very varied, and you must prepare for abuse.

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

Four the favorite of threads.

Thirteenth, have Java goto?

Very thirteen questions, if I ask this question, I advise you still in this company.

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?

I often ask.

Tenth, the elements in the set cannot be 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.

If you can't answer this, the interview will think that you don't have practical programming experience.

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?

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

Typographic

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?

Programmers with C background especially like to ask this question.

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.

Posted on July 12, 2004 6:05 PM href = "/ doodoofish / services / pingback.aspx" Rel = "pingback">

Feedback

# 回:: Java trap 1 basket ---- Interview title look forward to the answer!

2004-07-13 8:21 AM |

PASS

# 回:: Java traps a basket --- on the top of the topic set 1. Final is equivalent to constant modifiers

Part is always performed in the Finaly code block, which is often used behind an exception handling code block

Function before the object is eliminated in the Finalize GC

2. Cannot

3. Not clear. . .

4. Position and logic

5. Unclear

6. The container class is not clear. . .

7. I don't know> _ <

8. Garbage recycling, recycling resources

9.2

10.12 -11

11. S1 is short S1 1 result is an INT assignment type fault, one wrong may be the same

12. Forget the thread> <

13. Not

14. If so, if you are not very easy to get

15. Overload and overlay

16. I haven't used it, I feel that when equals () is the same object, == True

17. I have never dinched me.

18. Error object and exception object

19. No bar

20. There is no non-virtual member in the interface.

twenty one. OK

twenty two. Yes, Yes,

twenty three. Run

twenty four. can

25. Can you? ?

26. Cannot

27. Before, before

28.2 ^ 5?

29. Right

30. Quote

31. Yes or no

32. will not!

2004-07-13 9:15 AM |

I haven't seen Java for a long time.

# 没有有 看 书 印 印 印 第二 第二 第二 第二,, 第二 第二 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类 类

such as

AddActionListener (New ActionListener () {...};

AddMouseListener (new mouseadapter () {....});

3, not clear

5, thread safety hashtable seems to be JDK1.0 and vector one era

6Collection is an interface, and Collectes seems to have a lot of internal containers.

6 / Recycling memory resources

9 This is difficult to say, because this may be related to the implementation of the virtual machine

For example, if there is a string buffer in the virtual machine

Only create a new actual string, add one in the buffer pool

At this time, there may only be only one String Object is created for other two.

It may be 3, but it is impossible to be two

10 I don't answer this kind of mentally issue problem.

11 is another question

Don't ask if you go online for 5 minutes.

12 SLEP is not working in the middle of the rest and Wait will operate after being called this.

And the time of SLEEP can be set and Wait is going to see someone else's eyes.

13 Damn no goto c #

14 Array is Length is a field and the string Length is a method.

15 can be one way to cover the parent class to present a new behavior is another way to use it.

16 Equals == is physically equivalent of Equals is logical et al.

17 NULLPOINTER Parameter

18 Error is the programmer's own mistakes, the Exception is the problem that occurs because of the unsatisfactory resources.

19 MAP is not

20 The former has no

21 ABSTRACT METHOD in Abstract Class does not add these modifications because it only represents an entry, and it is true when it is realized.

22 can

23 Start

24 of course

25 Of course, it is not possible, the invariance is not inherited.

26 is of course not

27 In memory, it should be executed, it should be before returnium

28 2X8 I don't need to be in place, if you want to quickly, simply use C forget it.

29 Yes, however, however, sometimes problems like Hashmap, hashSet is found according to Hashcode and then compare, Effective Java said if you override Equals, you must override Hashcode.

30 is that if the value passes, if it is the basic type, if it is an object, it is a copy of the object reference (it is the basic type, like pointer.)

31byte and long are available in String

Because it is not a basic type, use Equals only

C # can be strange

32 is not written

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

New Post(0)