Use notepad to write the entire process of Java program diagram

  • 2020-04-01 03:05:53
  • OfStack

Java is an object-oriented programming language for writing cross-platform applications. It is the general name of Java programming language and Java platform (i.e. JavaSE, JavaEE, JavaME) introduced by Sun Microsystems in May 1995. Java technology is remarkably versatile, efficient, platform portable and secure, and is widely used in personal PCS, data centers, game consoles, science supercomputers, mobile phones and the Internet, with the largest professional community of developers in the world.

Create the first Java method

1 first, right-click to create a new text document.

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035317.jpg" width = 500 height = 470 >

2 change the suffix of the text document to.java. Note that the filename must be the same as the class name.

If you don't have a suffix on your computer you need to set it up.

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035318.jpg" width = 492 height = 367 >

3. Open the computer -- organization -- folder option -- view -- and uncheck the hidden folder option.

It is recommended to uncheck this option, there are many malicious programs will invade our computer, uncheck can be a good way to view the virus and other file types.

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035319.jpg" width = 500 height = 376 > < img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035320.jpg" width = 396 height = 448 >

4 right - click the document, select edit to write Java.

When we write, we have a certain format, the format of the Java language is for our convenience to change the program in the future and we must follow this format.

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035321.jpg" width = 500 height = 498 >

The second way

Create a new notepad document and select save.

Pay attention to the save location, don't wait until the end of the file can not find where.

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035322.jpg" width = 500 height = 398 >

Type the suffix ".java "in the selected save window and save. Note that the filename must be the same as the class name.

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035323.jpg" width = 500 height = 351 > < img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035324.jpg" width = 492 height = 367 >

3 also right - click the file, select edit can be edited in the file.

Press enter between the first two braces, and there is a space between the second pair of braces. Just press TAb.

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035325.jpg" width = 500 height = 498 > < img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035326.jpg" width = 500 height = 282 >

The test runs the Java program

Open the run command or directly enter the CMD call command window in the open menu.

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035327.jpg" width = 294 height = 500 > < img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035328.jpg" width = 500 height = 326 >

Type your file directory into the command prompt window where your file is saved. For example, mine is the D root directory, so I type "D:".

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035329.jpg" width = 500 height = 326 >

Compile the Java file to generate the class file.

At the command prompt, type "javac filename.java." my file name is A, so type javac a.java and press enter, waiting for compilation.

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035330.jpg" width = 500 height = 326 > < img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035331.jpg" width = 500 height = 231 >

Run the file.

Continue typing "Java file name" and press enter to run the file we wrote.

< img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035332.jpg" width = 500 height = 282 > < img border = 0 border = 1 Alt = how to use notepad to write a Java program SRC = "/ / files.jb51.net/file_images/article/201403/2014030610035333.jpg" width = 500 height = 326 >

Related articles: