官术网_书友最值得收藏!

Printing a string

Our goal with this HelloWorld program is pretty modest. When it runs, we'd like it to print some text to this output box at the bottom of our screen.

When we downloaded the Java SDK, we acquired a library of useful functions, one of which will do just this. This is the println(), or print line, function. When our Java code executes over this function, which it will do right away because it's the first function in our main() method's entry point, the Java code will print some words to our output box. Function names are followed by open and close parentheses. Inside these parentheses, we put information that the functions need to complete their task. The println() method, of course, needs to know what we would like it to print. In Java, a line of text is contained by two double quotation marks and we call it a string. Let's have our program print "Hello World!":

主站蜘蛛池模板: 个旧市| 应城市| 平乡县| 高密市| 云和县| 中宁县| 宜阳县| 化德县| 龙州县| 河西区| 湘潭市| 敦煌市| 望奎县| 临朐县| 茶陵县| 上思县| 汶川县| 万全县| 墨竹工卡县| 微山县| 湟中县| 道真| 肥乡县| 太原市| 林西县| 南涧| 岐山县| 确山县| 云和县| 金山区| 和平区| 西吉县| 五莲县| 图木舒克市| 赣州市| 博客| 南雄市| 嘉定区| 托克逊县| 新津县| 娄底市|