Java starts from the beginning of the first day (basic concept)

Source: Internet
Author: User

Object-Oriented Programming opp

Java is a class-and object-oriented computer programming language that supports concurrency.

Advantages

1 Code development modularity, easier to maintain and modify.

2 code reuse.

3 Enhance the reliability and flexibility of your code.

4 Enhance the reliability of your code.

Object-oriented programming has many important features: encapsulation, inheritance, polymorphism, and abstraction.

1. Encapsulation gives the object the ability to hide internal features and behavior. Object provides methods that can be accessed by other objects to change the data inside of him. In Java, there are 3 modifiers: public,private and protected. Each modifier gives different access rights to other objects in the same package or under different packages.

Advantages of Encapsulation

To protect the state inside an object by hiding its properties

Improve code availability and maintainability

Because the behavior of an object can be changed individually or extended

Prohibit undesirable interactions between objects improve modularity

2 polymorphism is the ability of a programming language to present the same pretext for different underlying data types, and an operation on a polymorphic type can be applied to other types of values

3 abstraction is the idea of separating the steps from a specific instance, so it's better to have their functionality instead of implementing the details to wear the class. Java supports the creation of abstract classes that expose only interfaces without the implementation of methods, the primary purpose of which is to divide the behavior and implementation details of a class away from

4 abstraction and encapsulation of different points: abstraction and encapsulation are complementary concepts, on the one hand, abstract attention to the behavior of objects, on the other hand, encapsulating the details of object behavior, generally by hiding the internal state information of the object to do encapsulation, so encapsulation can be seen as a strategy to provide an abstraction.

Extended

What is a Java virtual machine? Why Java is known as a platform-independent programming language

A Java Virtual machine is a virtual machine process that can execute Java bytecode, and the Java source file is compiled into a bytecode file that is executed by a Java virtual machine.

Java is designed to allow applications to run on any platform without requiring programmers to rewrite or recompile each platform individually, and the Java Virtual machine makes this possible because he knows the instruction length and other features of the underlying hardware platform.

What is the difference between JDK and JRE?

The Java Runtime Environment JRE is the Java virtual machine that will execute the Java program, and it also contains the browser plug-in required to execute the applet. The Java SDK jdk is a complete Java software development package that includes the JRE, compilers, and other tools (JavaDOC Java Debugger) that allow developers to develop, compile, and execute Java applications.

What does the static keyword mean? Can I overwrite (override) a private or static method in Java?

The Static keyword surface a member variable or a member method can be accessed without an instance variable of the class to which it belongs.

The static method in Java cannot be overwritten, because method overrides are dynamically bound based on the runtime, while the static method is bound at compile time. The static method is not relevant to any instances of the class, so it is conceptually not applicable.

Java starts from the beginning of the first day (basic concept)

Related Article

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.