Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement HelloWorld with Java

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

The editor will share with you how Java implements HelloWorld. I hope you will get something after reading this article. Let's discuss it together.

Import java.lang.* / * * 1. / / A double slash represents comments and is for people to see. The machine ignores 2. Public public is the keyword of java. 3. Class is called class. Each java file must contain a class 4. HelloWord name, which can be different from the file name. But the specification is generally written as the same 5. Static is called static, and the main method must be written by the static java virtual machine to find 6. Void is null, that is, there is no return value 7. Main is called the main method, which is the entry of the java program, which must be written in this way, otherwise the program cannot run. 8. A String string is a series of combinations of numeric characters enclosed in double quotes. String [] string array 10. Args calls the parameter of the main method 11. System: system, out: output println: print 12. The {} part after the class name is called the class body parenthesis must appear in pairs 13. The {} part after the main method main is called method body brackets must appear in pairs. Import java.lang.*; is called importing all classes under java.lang, but the classes under java default java.lang have been imported, and all java.lang packages are the only packages that java can omit without import. Coding specification: 1. The first word of the class name is capitalized. If there are multiple words, the first letter of each word is capitalized 2. Java is a case-sensitive language 3. When writing a class style, {} parentheses should appear in pairs. When writing the body of the method, {} parentheses appear in pairs. The method is written in the class body with a Tab space 6. 0 before each method. Each execution statement in the writing method body leaves a Tab space relative to the front of the method, and each execution statement is followed by a semicolon Indicates the end of the statement execution * / public class HelloWorld {public static void main (String [] args) {/ / print out Hello Word information to the console and then change the line System.out.println ("Hello Word") / / print input information to the console, but do not wrap System.out.print ("aaaa\ t"); System.out.print ("bbb");}} after reading this article, I believe you have some understanding of "how Java implements HelloWorld". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report