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 common Java commands?

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

Share

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

This article mainly introduces "what are the commonly used Java commands". In daily operation, I believe many people have doubts about the common Java commands. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about "what are the commonly used Java commands?" Next, please follow the editor to study!

I. the core concepts of Core Java

1. What do you mean by class?

A class is a general collection of something, an abstraction of the common characteristics of the same or similar things.

two。 What is a date?

In the object-oriented concept, an object (Object) is an instance of a class. The relationship between objects and classes is like the relationship between variables and data types.

3. What are the core features of the class?

Class has the characteristics of encapsulation, inheritance and polymorphism.

Encapsulation:

The encapsulation of a class provides multi-level access to members of the class, such as public, default, protected, and private, in order to hide the details of private variables and methods in the class.

Inheritance:

Inheritance provides a mechanism for creating a new class from an existing class, and inheritance (inheritance) makes a new class automatically own all the members of the inherited class (parent class).

Polymorphism:

The polymorphism of a class provides the diversity of method execution in a class, and there are two forms of polymorphism: overloading and overriding.

4. Method

The methods in the object express the behavior of the object. A method is actually a function.

5. Attribute

The property of an object is the data or state that can be perceived or manipulated by the outside world or the environment in which the object is located.

What is 6.Java?

Java is not only a cross-platform programming language that is easy to become, but also a platform for development, application, execution and deployment. Java includes Java programming language, development tools and environment, Java class library and so on. Java is a completely object-oriented programming language developed by Sun Company in the United States. Java language is developed from C++ language, but it is simpler than C++ language. Java language is simple, platform-independent, efficient, robust, safe, multithreaded and so on. It is the current network programming language. Java is both a programming language and a platform.

7. Why use Java?

The main reason is that Java is platform-independent, compiles once, runs everywhere, and its programmability.

8. What are the steps for developing a program with Java?

Write source code (* .java) → compile (javac * .java) → execution (java * .class)

Environment variables of 9.Java

Because Java is platform-independent, Java will not automatically set the path or modify the registry when installing JDK, so users need to set their own environment variables, but there is no need to modify the registry.

Installation path of JAVA_HOME:JDK

Search path when CLASSPATH:JVM loads, class bytecode files

PATH: the environment variable of the system, the search path of the command.

The path variable indicates the path to the executable file provided by Java

The class path variable indicates the path of the Java package (for Windows)

Set path=%path%; C:\ Program Files\ jdk1.5.0\ bin; set classpath=.; C:\ Progam Files\ jdk1.5.0\ lib

What is 10.JVM?

The JVM,Java Virtual Machine,Java virtual machine is a logical operating system that shields hardware and platform information. JVM can interpret and execute bytecode files (* .class). It is this way of independent execution that makes Java platform independent.

11. The loading process of the class

The class loader (class loader) loads the bytecode into memory, the JVM memory data area places the object state in the heap area, the variables used by each thread in the stack area, and the characteristics of the class in the method area. Bytecode verification (Byte code verifer) is then performed.

Second, commonly used Java commands

1.$javac

Compile source code

2.$javaclass [args]

Execute class files (Byte code files)

3.$jdb

Debug command

4.$javadoc [options] [packagenames] [sourcefiles] [@ files]

Generate Javadoc documents

5.$jar {ctxu} {jar-flie} [manifest-flie] [- c directory] fiels...

Extract jar file command

C: create a new compressed file (create)

T: make a list (tail)

U: update compressed file (update)

V: show compression process (view)

F: name of the compressed file (filename)

M; compress the specified information according to the list

III. Core Java grammar and specification

1. A source file has only one public class

2.public source files can have multiple class definitions

3. The source file name must be the same as the public class name

4. The package name must be on the * line (except annotation) comments are usually placed on the * line, and if the package is defined, the package definition is placed on the * line (the package is used to distinguish between classes with the same name and organizational classes)

5. Package names can be zero or one, but not more than one

6. If the source file comes with a package, it is stored in the directory corresponding to the package structure.

At this point, the study of "what are the commonly used Java commands" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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