Web-android Engineer-1-3 writing Java programs using Notepad

Source: Internet
Author: User

Step1:myProgram.java source files using Notepad editing

The Step2:compiler compiler uses the JAVAC command

Generate Myprogram.class Bytecode files

Step3. Interpreter interpreter using Java commands

Explain the running program

Example:

Add a text file to a path and rename it to Helloworld.java, for example: E:\android\code\HelloWorld.java

Edit the file with Notepad and enter the following

 Public class HelloWorld {    publicstaticvoid  main (string[] args) {        System.out.println ("Welcome to immoc!" );    }}


Then do the following on the command line:

(1) Javac Helloworld.java will generate helloworld.class after the command finishes executing

(2) Java HelloWorld Note Do not enter class

C:\USERS\ADMINISTRATOR>E:E:\>CD ANDROIDE:\ANDROID>CD codee:\android\code>lshelloworld.javae:\ The volume in Android\code>dir drive E is not labeled. The serial number of the volume is the directory of 4485-2636 E:\android\code 2014/09/07 Sunday pm 01:37<DIR>. 2014/09/07 Sunday afternoon 01:37<DIR>          .. 2014/09/07 Sunday pm 01:38 helloworld.java 1 files 115 bytes 2 directories 95,979 , 139,072 Available Bytes E:\android\code>javac helloworld.javae:\android\code>dir The volume in drive E is not labeled. The serial number of the volume is the directory of 4485-2636 E:\android\code 2014/09/07 Sunday pm 01:40<DIR>. 2014/09/07 Sunday afternoon 01:40<DIR>          ..               2014/09/07 Sunday pm 01:40 431 helloworld.class2014/09/07 Sunday pm 01:38 Helloworld.java 2 files 546 bytes 2 directories 95,979,139,072 Available Bytes E:\android\code>java helloworld.class error: Not found or cannot be added Load main class Helloworld.classe:\android\code>java helloworldwelcome to immoc! E:\android\code>


Web-android Engineer-1-3 writing Java programs using Notepad

Related Article

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.