Java's network functions and programming

Source: Internet
Author: User

Absrtact: This paper introduces how to use Java programming language to get images, sounds, HTML documents and text files from the network, and also introduces how to obtain network resources dynamically, and provides a lot of simple and understandable examples.

Key words: Java;internet network

The Java language is a new programming language on the Internet, and there are many articles about Java features and basic programming methods. However, the vast number of Java enthusiasts would like to know more about Java programming methods, this article on the Java network functions and programming methods to make a preliminary introduction.

In order to facilitate the first contact with Java readers, this article first on Java programming some common sense to briefly introduce.

Introduction to Java Programming

1. Programming Environment:

For most readers, the following configuration is a more economical option:

Operating system Win95

Compiling software JDK1.01

Browse software Netscape2.0 above (32-bit)

2. Programming Method:

First, use a text editor such as edit, Notepad, and so on to enter Java programs, to. java for file name suffix.

Then execute the command line: "Javac filename" to compile the Java program. Compile a bytecode file with a suffix of. class.

Finally, if it is a Java applitcation, execute the command line: "Java bytecode filename" to run the Java program.

If it is a Java applet, enter the HTML document that invokes the Java applet with a text editor, and save the file name suffix with. htm. To execute the command line again:

"Appletviewer HTML filename" to run the Java applet. Or use Netscape to open the HTML document.

3. Notes on the procedure in this article

In order to enable the program to embody the programming method that it represents most succinctly, the program in this article generally adopts the simplest form, omitting the thread and so on. Therefore, this article's program is not "good" program, but the easiest for beginners to understand.

After all the programs in this article have been compiled, the resulting bytecode files and corresponding HTML documents have been uploaded to Http://www.shu.edu.cn/~xyx/test/jvnet to run correctly. Readers connected to the Internet can open the address in a browser to see how it works.

Readers connected to the Internet can also enter and compile the program on the local hard drive, open the HTML document with Netscape's File/open File menu, experience programming methods, and see how it works. If the reader wants to place the Java Applet on its own host or on another FTP server, invoked by the HTTP protocol or the FTP protocol in Netscape, for security reasons, the following modifications should be made:

If the reader has an account number on a WWW host, you can do personal homepage (generally create the WWW or public_html directory in the user's root directory, homepage address is http://HostName/~ personal account), the corresponding HTTP in this program can be : The//www.shu.edu.cn/~xyx/section modifies the reader's own web node address, and then uploads the compiled bytecode file and the corresponding HTML document to its own node.

If the reader's computer is connected to the Internet, you can also find an FTP node that can be uploaded, such as: Ftp://ftp.shnet.edu.cn/incoming, the corresponding http://www.shu.edu.cn/~xyx/in this program Partially modify the address of the FTP node to upload the compiled bytecode file and the corresponding HTML document to the node to see how it works.

If the reader's computer is not networked, you can also run the Web service software on a single machine such as WebSTAR for Win95, modifying the corresponding http://www.shu.edu.cn/~xyx/section in this program to the "http://local IP address" form, To simulate network programming.

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.