☆ Write in front
A novice in the great pains to write a good Java program, with excitement to compile and execute Java program, The result error, what can not find the file, what does not exist, can not find the main method and so On. I am here on the file after extension, also known as the file suffix problem to Explore.
☆ Recognize and compare to
See what the difference is between the files in the two images below.
Group A
650) this.width=650; "src=" http://img.mp.itc.cn/upload/20160826/161f339321ff4e9d8f8041c44ad92b73.png "style=" border:0px;margin:0px;padding:0px;font-size:0px; "alt=" 161f339321ff4e9d8f8041c44ad92b73.png "/>
Group B
650) this.width=650; "src=" http://img.mp.itc.cn/upload/20160823/de95f3334649419f991fc5b83b91beb4.jpg "style=" border:0px;margin:0px;padding:0px;font-size:0px; "alt=" de95f3334649419f991fc5b83b91beb4.jpg "/>
Probably a glance, the icons are not consistent, look closely, the same extension format, B group looks normal, and a group seems to have a poison or damage feeling.
Actually a set of files created in the case of hidden extensions. This is the general computer installed system, the default Situation. Group B is the situation after the computer has been set up. So when we are developing Java programs, we have to set the Extensions. otherwise, just like group a, the default display is the TXT (text document also called Notepad) Format.
☆ Set Display file name extension (suffix Name)
Solutions for Win7
Open My Computer (computer), find the "tools" menu in the menu bar, find the "tools" menu, click on it, and then in the pop-up menu, look for "folder options" menu item Click on it, then will pop up as shown in the screen, click "view"
650) this.width=650; "src=" http://img.mp.itc.cn/upload/20160826/5545e096b9d34d1bb3c8e63791aa0918_th.png "style=" border:0px;margin:0px;padding:0px;font-size:0px; "alt=" 5545e096b9d34d1bb3c8e63791aa0918_th.png "/>
Pull 2, that is, right-click on the slider bar, the content is displayed in the position to Stop. Stop when you see "hide extensions for known files." At this point, remove the previous tick (make sure it is not checked), then click the "ok" button to go back to the desktop and you will see that the Group a file appears as follows
650) this.width=650; "src=" http://img.mp.itc.cn/upload/20160826/c24bf74532a5484c922e94c156c35aba.png "style=" border:0px;margin:0px;padding:0px;font-size:0px; "alt=" c24bf74532a5484c922e94c156c35aba.png "/>
You find that each file is followed by A. txt word, and you remove The. Txt. The computer will be prompted to change the extension, select Yes. YOU'LL see as shown in the following sequence of changes
650) this.width=650; "src=" http://img.mp.itc.cn/upload/20160826/3e7b1265b9e746e2bb491145d93c6674.png "style=" border:0px;margin:0px;padding:0px;font-size:0px; "alt=" 3e7b1265b9e746e2bb491145d93c6674.png "/>
And the Helloworld.java file you're writing is going to Change.
Before modification
650) this.width=650; "src=" http://img.mp.itc.cn/upload/20160826/897d7646b49d4473908d130fe82e9be6.png "style=" border:0px;margin:0px;padding:0px;font-size:0px; "alt=" 897d7646b49d4473908d130fe82e9be6.png "/>
After modification
650) this.width=650; "src=" http://img.mp.itc.cn/upload/20160826/125df0be11554922b1be6e8f0e1660c5.png "style=" border:0px;margin:0px;padding:0px;font-size:0px; "alt=" 125df0be11554922b1be6e8f0e1660c5.png "/>
In this way, you can continue to develop your own Java Programs.
WIN10 Solutions
Find "this computer", Open it, Find the "view" menu bar above click on it, then you will see a place like this, tick.
650) this.width=650; "src=" http://img.mp.itc.cn/upload/20160823/3e6813f39e764fe49ef6afa060e78ddb.jpg "style=" border:0px;margin:0px;padding:0px;font-size:0px; "alt=" 3e6813f39e764fe49ef6afa060e78ddb.jpg "/>
Win10 operation is relatively simple, as long as this is Checked.
☆ PostScript
When the extension is displayed, we can compile and run The. java-formatted file. It is important to note that when compiling a file contains the Extension. java, the runtime does not require the File's Extension. class.
When you do this, be sure to note the file name extension in this format when you create other format files on your computer. Such as, Word document Format doc, slide format ppt, notepad format txt,excel format xls and so On.
>>> for more information, please follow http://kaige123.com.
This article from the "11247808" blog, reproduced please contact the author!
About Java File extension recognition