Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic concepts to be mastered in the introduction to Java?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article shows you what are the basic concepts that need to be mastered in the introduction to Java. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Java's white paper gives us 11 key features of the Java language.

(1) Easy:Java syntax is relatively simple than C++, another aspect is that Java can make the software run on a very small machine, the basic explanation and class library support for the size of about 40kb, to increase the basic standard library and thread support memory needs to increase 125kb.

(2) distributed: Java has a very powerful routine library of TCP/IP protocol family. Java applications can access remote objects through URL through the network. Due to the emergence of servlet mechanism, Java programming is very efficient. Now many large web server support servlet.

(3) OO: object-oriented design is a programming technology that focuses on objects and their interfaces. Its object-oriented and C++ have many differences, in with the processing of multiple inheritance and Java's original class model.

(4) robust features: Java adopts a secure pointer model that reduces the possibility of rewriting memory and data crashes.

(5) Security: Java is used to design networks and distributed systems, which brings new security problems. Java can be used to build anti-virus and anti-attack System. Facts have proved that Java has done a better job in anti-virus.

(6) Neutral Architecture: Java compiles its architecture-neutral object file format that can be executed on many processors. The instruction bytecode (Javabytecode) generated by the compiler achieves this feature, which can be interpreted and executed on any machine.

(7) portability: Java has strict rules on the size and algorithm of basic data structure types, so portability is very good.

(8) Multithreading: the process of dealing with multithreading in Java is very simple. Java hands the multithreading implementation to the following operating system or threaded program to complete. So multithreading is one of the popular reasons for Java as a server-side development language.

(9) Applet and servlet: programs that can be executed on web pages are called Applet, and there are many browsers that support Java, while applet supports dynamic web pages, which many other languages cannot do.

Basic concept

The only thing that matters in 1.OOP is what the interface of the object is, just like the seller of the computer, no matter what the internal structure of the power supply is, he only cares whether he can provide electricity to you, that is, as long as he knows can or not rather than how and why. All programs are composed of certain attributes and behavior objects, the access of different objects is completed through function calls, and all communication between objects is through method calls, which greatly improves the reuse rate by encapsulating object data.

The most important idea in 2.OOP is the class, the class is the template is the blueprint, to construct an object from the class, that is, to create an instance of the class (instance).

3. Encapsulation: the implementation of combining data and behavior in a package) and hiding data from object consumers. The data in an object is called its instance field (instance field).

4. You can get a new class called inheritance by extending a class, and all classes are extended by the Object root superclass, which is described below.

5. Three main characteristics of object

Behavior--- shows what this object can do.

State--- the reflection of an object when it imposes a method.

The distinguishing mark between identity--- and other similar behavior objects.

Each object has a unique indentity and these three influence each other.

6. The relationship between classes:

Use-a: dependencies

Has-a: aggregation relationship

Is-a: inheritance relationship-- example: class An inherits class B. at this time, class A has not only class B methods, but also its own methods. (individuality exists in commonness)

7. Construction objects use constructors: the proposal of constructors, constructors are a special way to construct objects and initialize them.

Example: the constructor of the Data class is called Data

New Data ()-constructs a new object and initializes the current time.

Data happyday=new Data ()-assigns an object to a variable happyday so that it can be used multiple times. The value returned here is a reference that makes the variable different from the object variable.

Constructor features: constructors can have 0, one or more parameters

The constructor and the class have the same name

A class can have multiple constructors

The constructor did not return a value

Constructors are always used with new operators. [@ more@]

What are the basic concepts to be mastered in the introduction to Java? have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report