Getting Started in Java - Chapter 3 Java Program Design Foundation

zhaozj2021-02-17  68

Chapter III Java Program Design Foundation

3.1 Overview of Java Program

Now you can recover the backpoint of Java language, its basic structure is C / C , but people who use the program to describe the programs of the program can understand the large part of the Java language.

3.1.1 Programming

The source code code of the Java language consists of one or more compilation units, each of which can only contain the following content (except space and annotation): * A package statement * Entit statement (Import Statements) ) * Class Declarations * Interface Declarations Each Java's compiler can contain multiple classes or interfaces, but each compiler can only have a class or interface being public. The Java source program is compiled? REG; after the Java byte code is produced. Java's byte code is made by one? Copy; not dependent on the machine, this? Copy; the command can be effectively solved by Java's run system. Java's running system works as the same virtual machine. In the first Java implementation, each ed translated unit is a file that is .java is a folded file. Each compilend unit has a stem class, after compiling, each class is generated into a .class file. The .CLASS file is a code that the Java virtual machine can recognize.

3.1.2 Notes

The three types are as follows: // Note one line / * one line or multi-line note * / / ** text file note ** /

The document commentary is placed in a variable or function definition? REG; before, it refers to the transfer in any of the auto-generated document system. This is the description of the sound entry.

3.1.3 identifier

The names of variables, functions, classes, and objects are identifiers, and transcription needs to be labeled and used in east west. In the Java language, the identifier can be characterized by characters or _, $ opening, and the rear view can be included, the identifier is a large-size area, and there is no longitude limit.

Effective identifier MyName ICT_NETWORK HELLO _SYS_PATH $ BILL

Example: int a_number; char _ONECHAR; FLOAT $ BILL;

Key words Abstract Continue for New Switch

Boolean Default Goto Null Synchronized

Break do if package this

Byte Double Implements Private threadsafe

ByValue Else Import Protected Throw

Case Extends InstanceOf Public Transient

Catch False Int Return True

Char Final Interface Short Try

Class Finally Long Static Void

Const Float Native Super While WHILE

It protects the word to keep the words and use: Cast Future Generic Inneroperator Outer REST VAR

3.1.4 Durable

Java uses five basic types of basic types: Integer (integer), floating (floating point), Point (pointer), Boolean, Character or string (character or word ?? REG;). The data given under the integer integer is an integer: 4, 15, 089, 0xAd00

Integer length data type form

8 BITS BYTE

16 bits short

32 BITS INT

64 BITS long

The data given by the floating point of Floating floating point is the example of floating point: 6.37, 3.7e15, 3E8

Floating point number length data type

32 BITS FLOAT

64 Bits Double

Boolean Bull Variable is two can be used in Bull variables: True False

The example given by the Character character is the example of characters: A / T (Tab) / u ???? (Unicode)

String characters? REG; all the next is the character? REG; example: "this is a string literal" "China National Academic Court"

Arranges You can define any type of array. Char s []; this is a character array; int [] array; this is an array of arrays; you can also define an array of arrays. Int block [] [] = new int = 2 ] [3]; array boundaries are detected at runtime, avoiding stack overflow and memory crash.

In Java, the array is actually an object, and the array has a member variable: Length. You can use this member to find the length of any group. Int a [] [] = new int [10] [3] a.length / * 10 * / a [0] .length / * 3 * /

Creating an array creates an array in Java, you can use two basic methods? REG; one. Create an empty array: int list [] = new int [50]; or you can use the initial numerical fill an array. String names [] = {"chenji", "yuan", "chun", "yang"}; equivalent The following functions: string names []; names = new string [4]; names [0] = new string ("chenji"); names [1] = new string ("yuan"); names [2] = new string "Chun"); names [3] = new string ("yang");

When you edline, you can't create a static array in the following examples. INT Name [50]; // will generate a compiled error

You can't use new operation to fill an array that is not defined. INT Name []; for (int i = 0; i <9; i ) {name [i] = i;} 3.1.5 table

Java language table and C language is non-common class.

Operator operator (Operator) is ranked as follows: [] () -! ~ Instanceof * /% - << >> >>> <> <=> / ==! = & ^ && ||?: = OP =,

When the integer operator is integrated, if the number of operation is a long type, the calculation results are long type, no int class, will never be BYTE, SHORT or CHAR type. Thus, if the variable I is spacious as Short or Byte, the results of i 1 will be int. If the result is more than the value of this type, the mold is taken according to the maximum value of this type. The single-purpose integer operator is:

Operator operation - single eyeliner is not ~ bit complement plus 1 - minus 1

operators are used to represent direct plus 1 operation. Increasing operations can also be completed between add-in operators and assignment operations. Lvalue (left value? copy; represents Lvalue = 1, Lvalue also means Lvalue = LVALUE 1 (as long as LValue has no side effects). - operator is used to indicate minus 1 operation. and - operator It can be used as a prefix operator or a suffix operator. The double-scale integer operator is:

Operator Operation ** Add - Reduce * Multiply / Influence Mode & Bit and | Bit or ^ Different or << Lead Shot >> Right Move (with Symbol) >>> Add Zero Right Move

Integer division is rounded. Separation and Take Mode Compliance with Equation: (A / B) * B (A% B) == A integer algorithography calculation is made entirely of zero or according to zero molding. It will lead an algorithology. The lower overflow is generated, and the overflow is overflow. For example: add 1 exceeding the maximum value, after the mold is taken, become a minimum. A OP = assignment operator, and the two-purpose integer operators in the upper table are used as a table. Integer correlation operator <,>, <=,> =, ==, and! = Generates the boolean type data.

Boolean variables or formal sets of combined combination can produce new Boolean values. Single target! It is Bur. Budget Operators &, | and ^ are logical and xor operators, which strongly have two operative numbers. In order to avoid the number of ignitions for the right side, users can use short-circuit request operators & & and |. Users can use == and! =, And the assignment operator can also be used with & =, | =, ^ =. Trimetan condition operations?: And C speech. Floating-point operator floating point operators can use conventional operators: such as single operators , -, binocular operators ,, *, and /, and assignment operators =, - =, * =, And / =. In addition, there is also a mode operation:% and% = can also be used for floating point numbers, such as: A% B and A - ((int) (a / b) * b). This indicates that A% B results are divided by the remaining floating point number. Only the floating point table of the single-intensity operation is calculated according to the single-precision operation, and the results are produced. If the fruit floating point is included in the form of a double intensive number, according to the double intensity operation, the result is the number of double precision floating point.

The array operator array operator forms are as follows: [] gives a value of an element in an array. The value of the values ​​of the method is reduced from 0 to an array. Take the value of the value of the value is only engraved when it is running?

• REG; operator? REG; real as String object. The operator " " is completed and? REG; operation, if you must automatically switch the number of operations to String. If the operand is an object, it can define a method toString () returns the String mode of the object, such as Float a = 1.0 Print ("The value of a is" "/ n"); operator is used • An example String S = "a =" a; = operator can also be used for String. Note, the left (S1 in the next example) evaluates only one time. S1 = a; // S1 = S1 A // If a non-String type, automatic switch is String type.

Pairing Operator Budget Operator InstanceOf Test A pair is not an example of a specified class or a subclass. For example, if (MyObject InstanceOf myclass) {myclass anothermyObject = (myclass) myObject; ...} is to determine that myObject is an instance of MyClass or an example of its subclass.

Strengthening and converting Java language and interpretor restrictions use strong and convert to prevent the system collapse. Integer and floating point numbers? REG; mandatory conversion, but integer cannot be strongly converted into array or object. The object cannot be strongly based on the basic type. 3.1.6 Java flow control

Several control knots in the lower surface are borrowed from the C language.

Branch

IF / ELSE branch structure

IF (Boolean) {StateMaNets;} else {statements;

Switch branch structure

Switch (expr1) {CASE EXPR2: Statements; Break; Case EXPR3: STATEMENTS; Break;}

Cycling structure for cycle structure

For (Init EXPR1; Test EXPR2; Increment Expr3) {Statements;

WHILE cycle structure

While (boolean) {statements;}

DO cycle structure

Do {statements;} while (boolean);

General sequence control

Break [label] Continue [label] Reutr; label: statement

The FOR cycle example is a program case, drawing a few lines, which is red, green, blue color, which can be a part of the Java function:

Int count; for (count = 1; count <= 12; count ) {switch (count% 3)} case 0: setColor (color.red); break; case 1: setColor (color.blue); Break; Case 2 : setColor (Color.green); Break;} g.drawline (10, count * 10, 80, count * 10);

3.2 Example of Java variables and functions

Java's class package contains variables and functions. The data variable can be one? Copy; original type, such as int, char, etc. The member function is a "Copy; can be executed. For example, in the next step: public class classone {INT I; public classone () {i = 10;

Public void add_i (int J) {i = i j;}}

The ClassOne contains a variable I and two members functions, classone (int first), and add_i (int J).

The member function member function is one? Copy; can be used by its class or self-employment. A special member function is called a function, and this function name is sympathetically associated with this class. It didn't have a return value.

Configuration Functions and Members Functions When you define a class in Java, you can define one or more optional structural functions that initialize this object with a piece of configuration function when you create a pair of objects. Using the previous program example, when the ClassOne class creates a new instance, the membership function and variable are created (created an example). Configuration function is called. Classone MC: MC = New classone ();

The keyword NEW is used to create a class of instances. A class is initialized to initialize? REG; not occupying memory, it is just a type definition, when the MC object is initialized, the I variable in the MC object is equal to 10. You can core variables I via the object name. (Sometimes it is called? REG; for example variables) mc.i ; // MC instance variable plus 1 Because MC has all variables and member functions of the ClassOne class, we can use the same syntax to call member functions add_i: add_i (10); Now MC.I variable is equal to 21. End function Java does not support destructuring functions (definitions in C ), because Java itself is mentioned; the object is automatically cleared when it is useless, and it also mentioned Copy; an automatic pull The member function of the treasured box is called when the object is cleared: protected void finalize () {close ();}

3.3 Pair of effective range and waste self-recovery

There is a certain life period and the resources are used during its life. When a pair is no longer used, it should be released to avoid memory overflow. In Java, the collection and release of the memory is a responsibility called the sport call. This thread monitor is based on an effective range and gives an object that goes out of the effective range.

For example: string s; // No distribution S = new string ("oldString"); // Assign memory S = "newstring"; // Re-distribution memory (create new object)

We will have a better way to get a work process when we will access the String class later, but its fast work process is this: 1. Create a new String class object and populate it with "OldString" 2. Create another String object and populate Note that we have created two objects with "newstring". Stirng object "oldstring" stirng object "newstring"

In the third statement, the first embarrassment of "OldString", the pair of S, I have already gone, I have no way to visit him, and I am in a new object, I also called S, including "newstring". In the next waste referral, the previous object will be identified and clear.

3.4 subclasses

Subclasses are the use of a new object to create a new object, and if you have a Horse class, you can create a Zebra subclass, Zebra is one of Horse.

Class Zebra Extends Horse {Int Number_OF_Stripes:}

Key words extends to define a subclass of the object. Zebra is a subclass of HORSE. All features in the Horse class will copy to the Zebra class, while the Zebra class can define its own function and instance variables. Zebra is called Horse's distribution or relay. In addition, you also want to overcome the entry of the base class. Using ClassOne, the lower surface is an example of a class to cover the add_i function.

Import classone; public class newclass extends classone {public void add_i (int j) {i = i (j / 2);}} When the instance of the newclass class is created, the variable i initialization value is 10, but the add_i is called different results. . NEWCLASS MNC; Mnc = New newclass (); mnc.add_i (10);

When you have a new class in Java when you create a new class, you can take the talence variable and the entry level of the membership function.

Public public void AnyonecanAccess () {} PUBLIC instance variable and member function can be called.

Protected protected void onlysubclasses () {} protected instance variable and member function can only be called by its subclass.

Private private string creditcardNumber; Private instance variable and member function can only be called in this class.

Friendly void mypackageMethod () {} Default, if no fire control, instance variables or functions defaults to Friendly, means that they can be prevented by any object in this package, but other packages in other packages are unable to ask .

Static member functions and variables have? Copy; Waiting, you create a class, and I hope that all instances of this class are publicly variables. That is to say, all of this class has only the same copy of the instance variable. The keywords for this method are static, such as:

Class block {static int number = 50;

All Number variables of the object created from the Block class are the same. No Number's value is changed in which pair of Number is changed, and the Number of all objects will change. Similarly, you can define the Static member function, but this member function cannot access non-Static functions and variables.

Class Block {static int number = 50; int localvalue; static void add_local () {localvalue ; // no running} static void add_static () {Number ; // run}}

3.5 THIS and Super

When visiting an instance variable of a class, the THIS key word is a pointer to this class, in the front Classone example, we can increase the function function as follows:

Public class classone {INT I; public classone () {i = 10;

Public classone (int value) this.i = value;

Public void add_i (int J) {i = i j;}}

This, this point points to the Classone class. If you cover a member function of the parent class in a subclass, you want to call the members of the parent class, you can use the Super keyword to point to the members of the parent class.

Import classone; public class newclass extends classone {public void add_i (int j) {i = i (j / 2); super.add_i (j);}} The I variable is set to 10 in the following programs, then 15 Finally, the parent class is set to 25.

NEWCLASS MNC; Mnc = New newclass (); mnc.add_i (10);

Type 3.6

To now, I use only a public keyword in front of the class, and it has four selected selection:

Abstract A Abstract class must have at least one virtual function, an Abstract class cannot directly create an object, must be successful after the subclasses.

Final A Final Class sounds the end of the subclass chain, and the class of Final is unable to repay a child class.

Public Public Category can be accessed by its class. In other packages, if you want to use this class, you must first Import, no, it can only use it in its definition package.

SYNCHRONICABLE This class identification indicator is there? Copy; the class of the class isofunction.

3.7 Abstract class

One of the biggest advantages of facing the object is enough to define how to use this class without having to definitely define the function function. If the procedure is very useful, it is very useful, this does not require the user to use the same membership function.

An abstract class example in the java Graphics class as follows: public abstract class Graphics {public abstract void drawLine (int x1, int y1, int x2, int y2); public abstract void drawOval (int x, int y, int width, INT Height); Public Abstract Void DrawRect (int X, int y, int width, int tent); ...}

In the Graphics class, a few member functions were spoken, but the actual code of the member function was in another one? Copy;

Public class myclass extends graphics {public void Drawline (int X1, int y1, int x2, int y2) {}}

When a class contains an Abstract member function, this class must be defined as an Abstract class. However, not all of the members of the Abstract class is Abstract. The Abstract class cannot have a private member function (they can't be implemented), nor can there be a static member function.

3.8 interface

When you have a plurality of categories of fashion, the Abstract member function is very useful. But if you need to use this? Copy; Abstract member function, you must create a new class, which is very faster. Pixabay of interface. Copy; a profit method for extractive members. A plug-in contains a collection of members in another place. The member function is defined in the interface as public and abstract. Example variables in the interface are public, static and final. The main zone of interfaces and abrasions is an interface proposed. Copy; the method of encapsulating the member's function agreement without having to force the user. Example: public interface audiclip {// start playing the clip. Void play (); // play the clip in a loop. Void loop (); // stop playing the clip void stop ();

Want to use the class of the Audio Clip interface to use the Implencents keyword to mention the program code. Class Myclass Implements Audioclip {Void Play () {} void loop } void stop }}

Advantages A interface class can be implemented in an all-purpose class, each class can be shared, and there is no need to care about how it is. Class myotherclass implements audioclip {void stop () {} ...}

Interior member function Java also mentioned; Copy; Method for calling C and C functions. Use Native Keywords to define C and C functions.

Public class date {int now; public date () {now = time ();} private native int today ()

Static {System.loadLibrary ("Time");}}

When the Java code is written, you need the following steps: 1. Create a header file (.h) with Java 2. Create a Stub file with Javah 3. Write the code 4 of the Native member function with C and C . Compile the stub file and .c file into a dynamic to load library 5. Run the Java program or AppletViewer run with Java

Note: The Native member function exceeds the range of the class.

3.9 packages

Package is composed of a set of classes and interfaces (Interface). It is a tool that is a large-scale name interval, avoiding the names of the name. The names of each class and interface are included in a packet. According to the general habits, its name is constructed by "." Separated one word, the first single word is often the name of the organization that issued this package.

The package of the package compiletable unit for defining a compiletable unit is defined by the package statement. If you use the package statement, the first line of the compilation unit must have no null, and no reflection. Its format is as follows: package packagename; if the compiletable unit has no Package statement, the unit is placed in a default unknown package. Use the classes and interfaces in its bags in the Java language to mention Copy; a package can be used to use another package and the definition and implementation of the interface. Use the import keyword to mark the class from itself from it. A compiletable unit can enter the specified class and interface into its own package. There are two ways in a package to define classes and interfaces from other packets: * Give the names of their packages in front of each reference class and interface; // Prefix Package method ACME. Project .Foobar obj = new acme. Project. Foobar (); * Use the import statement to introduce a class or one interface, or contain them. The name of the class and the interface of the interface is available in front of the name. When you introduce a package, the public and interfaces available in the package are available. The forms are as follows: // Introduced from acme.project to all type import acme.project. *; This statement indicates that the public class in ACME.Project is introduced into the front package. Enter a class EMPLOYEC_LIST from the ACME. PROJECT package. // From Acme. Project, Employee_List Import Acme.Project.emPloyee_List; Employee_List Obj = New Employee_List (); When using an external class or interface, you must have a package in this class or interface, and you will produce compilation error.

Import Package (Class Package) Tune with the import keyword, specifying the package name such as a path and class name, and uses * match to adjust more than one class name.

Import java.date; import java.awt. *;

If the Java source file does not include package, it is placed in the default unknown Package. This is the same as the source document. Class can introduce this: import myclass.

Java system package: Java language mentioned Copy; a package containing window tooling suitcases, practical procedures, general I / O, tool and network function.

Java.applet This package is included. Copy; Design Applet class, use a class applet and three interfaces. AppletContext; AppletStub; and AudioClip.

Java.awa other window tool bag. The package is included in a Copy; the class of the ener-producery and GUI members. This package includes: Button, Checkbox, Choice, Component, Graphics, Menu, Pane1, Textarea and TextField.

Java.io I / O Package package Contains file input / output class, FileInput stream and file outputstream.java.lang This package contains Java language class, package: object, thread, different export, system, integer, origin, number, character, etc.

Java.Net This class supports the TCP / IP network protocol, and includes classes that contain the socket class, URL, and URL.

Java.util This class contains one? Copy; program synchronization, which contains a Date, Dictionary class, etc.

3.10 different

When a wrong mistake is generated in the Java program, an example: a variable element value is illegal, the code will now make this error and lead an exception. In the default situation, the different will often output an error message, then the latter line is executed. However, the program is self-disciplined, and it is recruited from the EXCEPTION HANDLER. Is there a copy; aiming is often brought by a Java interpreter during operation. In practice, anything can be defined to belong to its own vision, and use the throw statement to lead them. A throw (triggering? Copy; statement is made up by the throw keyword and an object. Press convention, the object should be an instance of the Exception class or an instance of its subclass. TROW statement causes the turn to the corresponding exception processing segment. When one When the throw statement is executed, all of the code below is no longer executed, and its method is no longer returned. The following example will demonstrate how to create an Exception subclass, then trigger an exception. Class myException Extection {} class Myclass {void OOPS () {if (/ * does not appear error * /) {...} else {/ * error * /

} Else {/ * Map * / throw new myException ();}}} is a group of code that can be produced in a truth sentence in order. Follow one or more CATCH back in the TRY statement, each exception corresponding to a catch statement. Each Catch statement contains an exception processing segment. For example: try {pa = 10;} catch (NullPointerexception E ) {Println ("P Was Null");} catch ("Other Errors Occured);} catch (object obj) {Println (" WHO Threw That Object? ");} Catch statement and one Method definition is similar, but this method only has only one parameter and has no return type. The parameter can be a class or an interface. When an exception occurs, the nesting TRY / CATCH statement looks for parameters matching the exception class. If a parameter and the specified exception match: * This parameter and the specified exception are the same class, or * This parameter is a subclass of the specified exception, or * If the parameter is an interface, the specified exception class implements this interface. A parameter and exception matching the TRY / CATCH statement, executes the Catch statement that matches it. After the Catch statement is executed, the execution of the program is restored. But it is not possible to return to an exception process. For example: Print (" "); try {print (" is "); throw new myexception (); Print (" a ");} catch (myException e) {print (" THE ");} print (" time / n "); Print "now is the time". As shown in this example, exception should be mainly used for error handling. If it is used for other aspects, it is difficult to make the code is obstructed. Reg ;. The abnormality processing section is nested, allowing exception processing happened at Multiple places. Nested is often used in the first time to completely recover from the wrong mist, no one is recovering from the wrong mist. Copy; Clear code. In order to handle the different levels of interest to the preliminary segment, you can reach the interception of the interception. Note to the time? Copy; Throw exception method, the throw statement will end the execution. Try {f. open ();} catch (exception e) {f. close (); throw e;}

Dingling statement Finally (DOPY COPY; statement is used to ensure that it is executed if it is incoming, it is executed in the case where the exception occurs. The following example shows the usage of the finally statement: try {/ / Do a? Copy; action;} Finally {// Since then;} and the following code Similar to Try {// Do? Copy; action} catch (object e) {// After cleaning; throw E;}} //, after the TRY block contains Return , Break, Continue, Throw statement, FINALLY statement is also performed. For example: The following code "Finally" is always output, and "after" is output only when A! = 10. TRY {IF (a == 10 ) {RETURN;}} finally {print ("finally / n");} Print ("after try / n");

The list of information listed at the time of running time is a variety of commonly used in the Java interpretation. When running, it is now a variety of wrong mistakes, and the detachase is distinguished.

ArithmeticException If the program is trying to except 0, or use 0 molding, arithmeticException is generated (arithmetic abnormal operation does not produce an exception. Information about how Java handles other arithmetic errors, see "Integer Operators" and "floating Point operator "two sections. For example: The following code will trigger ArithmeticException: Class Arith {public static void main (string args []) {int J = 0; J = J / J;}}

NullPointersException When the program tries to access variables or methods in an empty object, or when the elements in an empty array triggered NullPointerException (for example, an array of the length of 0 is 0) A [0]. There is the following statement. , Running nullpointerException exception: class null {public static void main (string args []) {string o = null; int a [] = null; o.length (); a [0] = 0;}} interest If we trigger an empty object, it will also produce a nullpointerException exception.

INCOMPATIBLASSCHANGEEXCEPTION When a class is defined, it will produce this distant when it is not re-edited by other classes. There are four types to change the incompactionClassChangexception during the time of running. * Variable in a class becomes static to non-Static, and it is not re-edited by the class that has access to this class. * Volumes in a class are made by non-Static into static, while the class that has access to this class is not re-edited. * A domain in the class is deleted, and it has access to the domain of the domain without being re-edited. * A method in the category is deleted, and its approach to this method is not re-edited. ClassCastException, try to put the object O strongly into Class C, and o is neither Class C instance, nor an example of a Class C subclass, which will produce ClassCastException. Class classcast {public static void main (string args []) {Object O = new object (); string s = (string) O; s.LENGTH ();}}

}

NagativeArraysizeException If the length of an array is negative, the NagativeArraysizeException is triggered. For example, the code that is defined below triggers this exception at runtime: Class Negarray {public static void main (string args []) {Int a [] = new int [-1]; a [0] = 0;}}

OUTOFMEMORYEXCEPTION When the system cannot mention it to the application? Copy; Memory, OutofMemoryException (memory overflow? Copy; exception can only appear when the new object is created, that is, the New is called. For example, the following The code will trigger outofmemoryexception exception at runtime: class link {int a [] = new int = →} class outofmem {public static void main (String args []) {

Public static void main (string args []) {link root = new link (); link cur = root; while (true) {cur.l = new link (); cur = cur.l;}}}

NOCLASSDEFFOUNDEPTION If a class is referenced, but at runtime, the system does not find the referenced class. At this time, NoclassDeffoundException (not found Class definition is found; Copy; Exception. For example, the Noclass class declaration is as follows: Class Noclass {public static void main (String args []) {c c = new c ();}} When the NOCLASS is running, if the interpreter does not find C class, NoclassDefoundException is generated. Note that the C class must exist when Noclass is compiled. IncompatibleType exception if an attempt is an interface for instance, is raised IncompatibleTypeException (incompatible type copy;?.. abnormality example, the following code will trigger a IncompatibleTypeException interface I {} class IncompType {public static void main (String args []) { I r = (i) New ("i");}}

When ArrayIndexOutOfBoundsException trying to access an array of an illegal element, it can cause ArrayIndexOutOfBoundsException (array index out of bounds copy; abnormalities such as:? Class ArrayOut {public static void main (String args []) {int a [] = new int [0];. a [0] = 0;}}

Public static void main (string args []) {Int a [] = new int [0]; a [0] = 0;}} UnsatisfiedLinKexception If a method is declared as the unit, the method is not connected at runtime When a routine is up, unsatisfiedlinkedException will generate (unable to connect Copy; exception. For example: Class Nolink {static native void foo (); public static void main (string args []) {foo ();}}

INTERNALEXCEPTION INTERNALEXCEPTION (inner? Copy; Available cannot be bracked. This is also introduced only when the operation is lost.

chapter summary

1. Basic symbol of Java language C / C . 2. The source program code of Java language is composed of one or more compilation units.

转载请注明原文地址:https://www.9cbs.com/read-29497.html

New Post(0)