"Java Virtual machine explaining" Reading notes-chapter I Java architecture

Source: Internet
Author: User

This chapter focuses on the architecture of the Java architecture, including four aspects: Java programming language, bytecode, Java API and Java Virtual machine four

And a brief introduction of the above four parts, at the same time, some new features in Java are introduced, because I read this book Java8 has been published, so some of them said to be implemented in the subsequent version of the functionality has been implemented, such as lambda expression, functional programming, etc., Finally, the use and compilation of OPENJDK are introduced.

Here are some of the concepts you don't know before reading

    1. Lambda expression

      What is a λ-expression

The lambda expression is essentially an anonymous method. Let's take a look at the following example:

public int Add (int x, int y) {

return x + y;
}

This is what it looks like after turning into a lambda expression:
(int x, int y), x + y;

Parameter types can also be omitted, and the Java compiler is inferred from the context:

(x, y), x + y; Returns the sum of two numbers

Or

(x, y), {return x + y;}//indicates the return value explicitly

The lambda expression is visible in three parts: A parameter list, an arrow (-a), and an expression or a block of statements.

The lambda expression in the following example has no parameters and no return value (equivalent to a method that accepts 0 parameters and returns void, which is actually an implementation of the Run method in the runnable):

(), {System.out.println ("Hello lambda!");}

If there is only one parameter and can be inferred by Java, the parentheses of the argument list can also be omitted:

C--{return c.size ();}

Can only understand this here, and then read a little to make up a little

2.Osgi

the OSGi (Open Service Gateway Initiative) technology is designed for Dynamic model system for Java. The OSGi service platform provides services to Java, which makes Java a preferred environment for software integration and software development. Java provides portability for products that are supported on multiple platforms. OSGi technology provides standardized primitives that allow applications to be built using refined, reusable, and collaborative components . These components can be assembled into an application and deployment.

Still do not understand very much, see a few times in the future good

"Java Virtual machine explaining" Reading notes-chapter I Java architecture

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.