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

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

主站蜘蛛池模板: 铜川市| 清丰县| 尉氏县| 余江县| 巴塘县| 嘉峪关市| 绍兴市| 历史| 通渭县| 乡宁县| 云梦县| 合川市| 江油市| 普定县| 固原市| 巴马| 海兴县| 大宁县| 葫芦岛市| 德清县| 滦南县| 苏尼特右旗| 浑源县| 静乐县| 黄山市| 崇明县| 邵武市| 福州市| 调兵山市| 林西县| 安化县| 商城县| 涿鹿县| 祥云县| 施秉县| 盐山县| 凤凰县| 北安市| 营山县| 白银市| 黄石市|