Summary of Java Fundamentals (II.)

Source: Internet
Author: User

The difference between & and &&:

Bitwise AND: A&B is a bitwise operation that converts both A and b into binary numbers. If a bit of two numbers is 1, then the result of the bitwise operation is only 1. The final result of the operation is a number.

Logic and: A&&b is the result of true when and only if both A and B are true. The end result is true or false.

Bitwise AND (&) can also be used as logic, but it is not a short-circuit function compared with &&. The so-called short-circuit, is a&&b, if after the operation A is false, then no longer waste time to judge B.

Reference Link: http://blog.csdn.net/sundenskyqq/article/details/27788617

The difference between final,finally,finalize:

Final: Table end state, prevent expansion. A decorated field represents a constant, and a decorated method indicates that the method cannot be overridden and overloaded; the decorated class indicates that the class cannot be inherited and cannot be extended.

The Finally:java exception-handling statement that represents the part that is always executed.

Finalize: Is a method of the object class that invokes the method of the reclaimed object when the garbage collector executes it.

What is the difference between sleep () and wait ():

The difference between override and Overload:

Override: Override/overwrite. Overrides are a representation of the polymorphism of a parent class and a subclass. If a subclass of a method has the same name and arguments as its parent class, but the method body is different, we say that the method has been rewritten.

When an object of a subclass calls this method, the method in the subclass is called, because this method in the parent class "overrides" in the Quilt class.

Overload: Overloaded. Overloading is a representation of polymorphism in a class. If there are multiple methods with the same name in the same class, but their parameters are different and the return value may be different, then we say that the method is overloaded.

The difference between EJB and Java Bean:

Does the array have the length () method? Does string have the length () method?

The array does not have the length () method, only the length property;

String has the length () method.

String

  

Summary of Java Fundamentals (II.)

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.