In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what are the key features of Java", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "what are the key features of Java"!
Document the Java: Sun Microsystems White Paper--Draft by James Gosling and Henry McGilton, October 1995--describes the following key features of Java:
*Simple and familiar
*Object-oriented
*Architecture-neutral
*Portable
*Somewhat Interpreted
*Distributed
*Robust
*Secure
*High performance
*Multi Threaded
*Dynamic
Java Features--Simple and Familiar
Java omits some rarely used, obscure, and confusing features of C++, including operator overloading, multiple inheritance, pointers, and automatic type coercion.
It adds automatic garbage cleanup, making dynamic programming easier in Java than in C or C++.
No more mallocs!
It also adds the `interface ´ construct, similar to the concept of Objective C, which is often used to compensate for the lack of multiple inheritance by allowing method call syntax to be "inherited."
As a result, because it is similar to C++, users will be familiar with it and easy to program.
Another consequence of this is that the kernel becomes small enough for consumer electronics. The basic interpreter (alpha) is ~40Kb, libraries and clues require an additional 175 Kb.
Java Features--Object Oriented
The Java model can be viewed as a subset of C++, with some dynamic elements inherited from Objective_C (method overloading, garbage collection).
Structures, unions, and functions are abstracted into Java class data and methods- Java is simpler!
The strength of the Java model lies not only in its simplicity but also in the expansion of system-specific libraries (approximately 250 public libraries released in alpha and beta).
Java classes also act as communication units in the Web embedding model. Applet classes identify themselves by name in HTML applet tags. Applet Downloads additional classes that appear in the applet source program. Thus, Java class names act as address patterns for distributed Java code databases.
Java Features--Structurally Neutral
C/C++ programming in heterogeneous network environment needs to use and be compatible with multiple platforms and corresponding compilers. This problem is solved in Java by designing a platform-independent binary description interpretation called bytecode(or opcode).
Java compiler (written in Java, platform independent) reads Java source code to generate Java bytecode. These bytecodes are sent to the client machine according to the browser's requirements.
Each client machine must run the Java interpreter, which performs the interpretation of Java bytecode. The Java interpreter is written in POSIX ANSI C and needs to be sent to each individual platform for a regular compilation.
Once the interpreter is ready, application developers don't have to worry about any platform specifications and distinguishing between different native compilers.
Java Features--Movable
The Java language provides a unified abstract (virtual) machine model that is consistent across all platforms.
SUN owns the Java Virtual Machine--it's generic, and any user can add classes to it.
Unlike C/C++, which requires manual matching of different integers to physical machine structures, Java bytes, char short, int, and long are always the same size, equal to 8, 16, 16(unicode), 32, and 64 bits respectively.
No header files, preprocessors,#define, etc.
Floating point numbers are always IEEE 754
Description of differences between specific window environments (X Windows, MS Windows, Macintosh) eliminated according to the Abstract Windows Toolkit (AWT).
AWT is written in ~60 Java class (alpha), it provides a common GUI programming model, can be moved on UNIX, PC and Mac, automatically translated by Java interpreter to the native platform window system.
Java features--partial explanation
Java represents a compromise between complete compilation (such as C/C++) and complete interpretation (such as Smalltalk or Perl).
Java "compilers" produce a binary bytecode output that is removable and much smaller than the binary code actually required for a particular machine.
The Java "interpreter" executes this bytecode and is therefore less dynamic than interpreters such as Perl (which internally implement an equivalent bytecode construct that on-the-fly when reading the program source code).
Typically, the editing process is: a) time consuming and b) platform specification. Thus, interpreters are used to facilitate a) rapid prototyping and/or b) mobility. The Java model focuses on platform independence but efficiency is also appropriate because Java compilers are faster and produce concise bytecode output.
Java Features--Distributed
Popular TCP/IP-based protocols such as FTP or HTTP are supported according to network protocol classes. This facilitates various forms of distributed processing. New protocols (such as PVM ) can be added and dynamically installed.
Java's distributed computing model is mainly client-server, Java compiler prepares opcodes on the server side, Java interpreter executes them on the client side.
Users can expect more dynamic usage with Java threads communicating between server and client.
Java Features--Robustness
Java enhances compile-time type checking, eliminating some C/C++ bugs in this area.
Pointer algorithms are abandoned entirely for runtime checking of array subscripts and for security enhancements to the Java model.
Explicit specification is always required, i. e. implicit specification of type C is abandoned. This allows the Java compiler to perform early error checking.
Rapid prototyping in Java isn't as good as JavaScript,Lisp, Tcl, Smalltalk, or Perl, but Java's software quality assurance is better than these more dynamic and generous languages.
Java Features-- (Desired) Security
Java binary code is transmitted across the network and executed on client machines. So security is a critical issue and is heavily enforced in Java.
Java has its own network classes designed in a secure way
Modifications to the C++ model such as removing pointer algorithms and casting are mainly based on security considerations.
Most viruses are implemented based on access to private/protected computer memory, which is impossible in Java.
Java opcode is executed by the Java interpreter in virtual memory exclusively on the client side. Therefore, unless Java interpreter itself has security vulnerabilities, the module is secure and users cannot create security vulnerabilities by writing applets incorrectly or maliciously.
Bytecodes sent across the network are checked at the client side to prevent malicious/wrong classes from causing problems
Java Features--High Performance
Java interpreter completes the on-the-fly runtime execution of Java bytecode and obtains satisfactory performance.
NOT true in initial software which is often 100 times slower than C but this is expected to improve as true compilers are produced and general software improves!
Support for generating native machine-dependent code from bytecode, which, in the form of a mid-level compiler, satisfies high performance applications.
The performance of machine code generated from Java bytecode is comparable to that provided by a typical C/C++ compiler for the same platform.
Some of the concepts here are actually similar to OSF/ANDF. Using ANDF terminology, we can call the Java compiler a 'producer,' and the machine code generator in question is an 'installer.' By default Java does not use installers but interprets intermediate code forms directly (this is supported by GAI -- Generalized ANDF Interpreter in ANDF).
ANDF model can be applied to all languages in principle. Java/HotJava system implements ANDF concept for Java language.
Java Features--Multiple Clues
The Java model provides priority multiple threads, executed on top of the Thread class. The cueing method is based on C.A.R. Hoare's Watchdog and Conditional Variable Changelog provides a set of time synchronization primitives. Java threads inherit features from Xerox Park's pioneering Cedar/Mesa system, which created Macintosh and object-oriented programming.
A typical application of Java multithreading in applet programming is simulation of several independent but interrelated situations (such as sorting algorithms) running simultaneously in an applet window. Multithread is also used internally in the HotJava browser to handle multiple dynamic documents.
Another interesting application area is the case of multi-hot Java environments, such as collaborative labs or games
Java thread built-in point-to-point communication primitives. The context for threaded communication can be provided by a combination of threads and network protocol objects.
Java Features-- It Dynamics
The Java model is more dynamic than C++ and closer to Smalltalk or Perl.
Subclasses do not need to be recompiled after the parent class implementation is updated.
Classes have runtime statements (implemented as Class) that allow users to view the type of a given object instance at runtime (in C, they cannot know if the pointer is to an integer or the browser)
C++ has a "fragile parent class" problem. If you change anything (method/instance variable) in the parent class or the referenced class, you must recompile the subclass. Java solves this problem by resolving class references at runtime.
At this point, I believe that everyone has a deeper understanding of "what are the key features of Java", so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.