{"id":693,"date":"2023-03-23T21:50:23","date_gmt":"2023-03-23T13:50:23","guid":{"rendered":""},"modified":"2023-03-23T21:50:23","modified_gmt":"2023-03-23T13:50:23","slug":"Java \u7a0b\u5e8f\u4f8b\u5b50","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/693.html","title":{"rendered":"Java \u7a0b\u5e8f\u4f8b\u5b50"},"content":{"rendered":"
\n
<\/span> <\/p>\n \u5982\u679c\u5c1a\u672a\u5b89\u88c5JDK\uff0c\u8bf7\u5b89\u88c5\u5b83\uff0c\u4e0b\u8f7dJDK \u5e76\u5b89\u88c5\u3002 <\/span> <\/span> <\/p>\n class: <\/strong>\u5173\u952e\u5b57\u7528\u4e8e\u5728Java\u4e2d\u58f0\u660e\u4e00\u4e2a\u7c7b\u3002<\/span> <\/p>\n <\/span> <\/p>\n Java Hello World\u793a\u4f8b\u7684\u8981\u6c42<\/h3>\n
\n \u8bbe\u7f6ejdk\/bin\u76ee\u5f55\u7684\u8def\u5f84\u3002 http:\/\/www.lidihuo.com\/java\/java-how-to-set-path.html <\/span>
\n \u521b\u5efaJava\u7a0b\u5e8f<\/span>
\n \u7f16\u8bd1\u5e76\u8fd0\u884cJava\u7a0b\u5e8f<\/span> <\/p>\n
\n\u521b\u5efaHello World\u793a\u4f8b<\/h3>\n
class Simple{
public static void main(String args[]){
System.out.println(\"Hello Java\");
}
}
<\/span><\/code><\/pre>\n<\/p><\/div>\n\n\n
\n \u64cd\u4f5c<\/td>\n \u4ee3\u7801<\/td>\n<\/tr>\n \n \u7f16\u8bd1: <\/strong> <\/td>\n javac Simple.java <\/td>\n<\/tr>\n \n \u6267\u884c: <\/strong> <\/td>\n java Simple<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u8f93\u51fa: <\/strong> Hello Java
<\/span><\/code><\/pre>\n<\/p><\/div>\n<\/p><\/div>\n <\/p>\n
\u7b2c\u4e00\u4e2aJava\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u7684\u53c2\u6570<\/h2>\n
\n public: <\/strong>\u5173\u952e\u5b57\u662f\u4e00\u79cd\u8bbf\u95ee\u4fee\u9970\u7b26\uff0c\u4ee3\u8868\u53ef\u89c1\u6027\u3002\u8fd9\u610f\u5473\u7740\u6240\u6709\u4eba\u90fd\u53ef\u4ee5\u770b\u5230\u5b83\u3002<\/span>
\n static: <\/strong>\u662f\u5173\u952e\u5b57\u3002\u5982\u679c\u6211\u4eec\u5c06\u4efb\u4f55\u65b9\u6cd5\u58f0\u660e\u4e3a\u9759\u6001\u65b9\u6cd5\uff0c\u5219\u79f0\u4e3a\u9759\u6001\u65b9\u6cd5\u3002\u9759\u6001\u65b9\u6cd5\u7684\u6838\u5fc3\u4f18\u70b9\u662f\u65e0\u9700\u521b\u5efa\u5bf9\u8c61\u6765\u8c03\u7528\u9759\u6001\u65b9\u6cd5\u3002 main\u65b9\u6cd5\u7531JVM\u6267\u884c\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u521b\u5efa\u5bf9\u8c61\u6765\u8c03\u7528main\u65b9\u6cd5\u3002\u8fd9\u6837\u53ef\u4ee5\u8282\u7701\u5185\u5b58\u3002<\/span>
\n void: <\/strong>\u662f\u65b9\u6cd5\u7684\u8fd4\u56de\u7c7b\u578b\u3002\u8fd9\u610f\u5473\u7740\u5b83\u4e0d\u8fd4\u56de\u4efb\u4f55\u503c\u3002<\/span>
\n main: <\/strong>\u4ee3\u8868\u7a0b\u5e8f\u7684\u8d77\u70b9\u3002<\/span>
\n String[]: <\/strong>\u53c2\u6570\u7528\u4e8e\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6211\u4eec\u7a0d\u540e\u4f1a\u5b66\u4e60\u3002<\/span>
\n System.out.println(): <\/strong>\u7528\u4e8e\u6253\u5370\u8bed\u53e5\u3002\u5728\u8fd9\u91cc\uff0cSystem\u662f\u4e00\u4e2a\u7c7b\uff0cout\u662fPrintStream\u7c7b\u7684\u5bf9\u8c61\uff0cprintln()\u662fPrintStream\u7c7b\u7684\u65b9\u6cd5\u3002\u7a0d\u540e\u6211\u4eec\u5c06\u4e86\u89e3System.out.println\u8bed\u53e5\u7684\u5185\u90e8\u5de5\u4f5c\u3002<\/span> <\/p>\n
\n
\n \u5f00\u59cb\u83dc\u5355->\u6240\u6709\u7a0b\u5e8f->\u9644\u4ef6->\u8bb0\u4e8b\u672c<\/b>\u6253\u5f00\u8bb0\u4e8b\u672c\uff0c\u5e76\u7f16\u5199\u4e00\u4e2a\u5982\u4e0b\u6240\u793a\u7684\u7b80\u5355\u7a0b\u5e8f:\n <\/div>\n <\/p>\n
\n \u5f00\u59cb\u83dc\u5355->\u6240\u6709\u7a0b\u5e8f->\u9644\u4ef6->\u547d\u4ee4\u63d0\u793a\u7b26 <\/b>
\n
\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u3002\n <\/div>\n <\/p>\n
\n\n
\n \u8981\u7f16\u8bd1\u5e76\u8fd0\u884c\u4e0a\u8ff0\u7a0b\u5e8f\uff0c\u8bf7\u9996\u5148\u8f6c\u5230\u60a8\u7684\u5f53\u524d\u76ee\u5f55\uff1b\u6211\u5f53\u524d\u7684\u76ee\u5f55\u662fc:\\new\u3002\u5728\u8fd9\u91cc\u5199: <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \n\n
\n \u64cd\u4f5c<\/td>\n \u4ee3\u7801<\/td>\n<\/tr>\n \n \u7f16\u8bd1: <\/strong> <\/td>\n javac Simple.java <\/td>\n<\/tr>\n \n \u6267\u884c: <\/strong> <\/td>\n java Simple<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\n\u6211\u4eec\u53ef\u4ee5\u7528\u591a\u79cd\u65b9\u6cd5\u7f16\u5199Java\u7a0b\u5e8f<\/h2>\n
static public void main(String args[])
<\/span><\/code><\/pre>\n<\/p><\/div>\n public static void main(String[] args)
public static void main(String []args)
public static void main(String args[])
<\/span><\/code><\/pre>\n<\/p><\/div>\n public static void main(String... args)
<\/span><\/code><\/pre>\n<\/p><\/div>\n class A{
static public void main(String... args){
System.out.println(\"hello java4\");
}
};
<\/span><\/code><\/pre>\n<\/p><\/div>\n
\n\u6709\u6548\u7684Java\u4e3b\u65b9\u6cd5\u7b7e\u540d<\/h2>\n
public static void main(String[] args)
public static void main(String []args)
public static void main(String args[])
public static void main(String... args)
static public void main(String[] args)
public static final void main(String[] args)
final public static void main(String[] args)
final strictfp public static void main(String[] args)
<\/span><\/code><\/pre>\n<\/p><\/div>\n
\n\u65e0\u6548\u7684Java\u4e3b\u65b9\u6cd5\u7b7e\u540d<\/h2>\n
public void main(String[] args)
static void main(String[] args)
public void static main(String[] args)
abstract public static void main(String[] args)
<\/span><\/code><\/pre>\n<\/p><\/div>\n
\n\u89e3\u51b3\u9519\u8bef\"\u65e0\u6cd5\u5c06Javac\u8bc6\u522b\u4e3a\u5185\u90e8\u6216\u5916\u90e8\u547d\u4ee4\"\uff1f<\/h3>\n
\n \u5982\u4f55\u8bbe\u7f6eJava Path\n <\/div>\n
\n <\/body>
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"Java \u7a0b\u5e8f\u4f8b\u5b50zh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[111],"tags":[],"class_list":["post-693","post","type-post","status-publish","format-standard","hentry","category-java-jichu"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/693"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=693"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/693\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}