Java, why the misunderstanding is so deep

Source: Internet
Author: User

A few days ago by telephone interview, ask Java parameter Pass way, I said only one way, is by value Ah, the other side corrects me to say, the basic type passes the value, the object type passes the reference; Alas, I was choked, and after a few seconds, I knew what he meant, and I knew that I had met the new man of the new century, But I am afraid he does not understand Ah, say we still first to "reference" the concept of definition, do not have the same word two people have two meaning, or for example, in the function of the string type parameter assignment is not affect the actual parameters Ah, so he also understand I actually understand that the phone interview even if the

However, not finished, formal interview four rounds: Pen Test, after the written test and leader talk, after talking with the manager talk, after talking with the VP, incredibly each round has this problem! Just replaced the form of the swap function, let you say the implementation of the results; I was bored, this problem in the minds of people so big image? And the answer of the party A is specious?

Bjarne has always thought that the education of C + + is harmful to C + +, then what harm the Java language? Excessive Commercial publicity!

Of course, the business promotion successfully helped the Java platform, attracted a large number of developers, but for the Java language, the first to hear the word before the beginners to learn, the ears are full of "Java canceled pointer", "Java has no memory leaks", "Java-oriented" and other promotional language, The preconceptions accept the superficial phenomenon without understanding the substance of the problem.

Java cancels the pointer? Look at the exception thrown when the so-called "reference" is empty, and see what this thing is in the eyes of the Java creator: nullpointerexception! Not that I despise Sun, The details of its disguise is indeed inferior to ms:.net in the corresponding anomaly called NullReferenceException, although it is also a new way; as a Class C language, I think the corresponding concept of the name is still better, Java is in fact all pointers, you basically can not get the object itself, but this pointer function is limited, not You need to delete it.

The concept of pointers is disguised and no delete is required, but what about resources other than memory? Count how many finally you have in your program.

Java Pure object oriented? In fact, this sentence itself is understandable, but it uses the << Swordfish action >> defined in the "wrong guide", this sentence will make beginners tend to think that the Java-written program is object-oriented, thereby hindering the understanding of real object-oriented Count how many of your programs are based on the switch/if/else of the object type.

Digression:

The interview was asked about three basic features of object-oriented I know what he wants to hear. Encapsulation inherits polymorphism, but in fact the core feature of traditional object-oriented is polymorphism, and inheritance is just a means to realize polymorphism, not essential feature; C language is not inherited, but can also be OO-style programming




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.