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

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!":

主站蜘蛛池模板: 黔东| 平江县| 惠州市| 陇川县| 衡阳县| 鸡泽县| 大庆市| 南充市| 水城县| 府谷县| 桃源县| 道真| 清流县| 蕲春县| 岳普湖县| 丹寨县| 海伦市| 石楼县| 东平县| 高要市| 宿松县| 崇仁县| 麦盖提县| 宣恩县| 渭源县| 绥中县| 太白县| 辽源市| 武陟县| 新乡市| 太原市| 杭锦后旗| 那坡县| 县级市| 长春市| 崇明县| 哈密市| 乐东| 灵寿县| 墨玉县| 高碑店市|