{"id":607,"date":"2022-08-27T10:03:24","date_gmt":"2022-07-21T13:04:50","guid":{"rendered":"https:\/\/www.silicloud.com\/blog\/uncategorized\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/"},"modified":"2024-03-13T15:43:32","modified_gmt":"2024-03-13T15:43:32","slug":"the-main-method-in-java-is-declared-as-public-static-void-mainstring-args","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/","title":{"rendered":"The main method in Java"},"content":{"rendered":"<h3>The following is an option for paraphrasing the given sentence natively: &#8220;To begin with, let&#8217;s delve into the introductory section.&#8221;<\/h3>\n<p>The main method in <a href=\"https:\/\/www.java.com\/\">Java<\/a> is typically the initial method taught when beginning Java programming as it serves as the starting point for running a Java program. It can include code to execute or invoke other methods, and it can be situated within any class in a program. Typically, more intricate programs have a class solely dedicated to housing the main method, often named Main.<\/p>\n<p>In the subsequent illustrations, the class named Test includes the primary method.<\/p>\n<div>\n<p>Here is one possible native paraphrase option for &#8220;Test.java&#8221;:<\/p>\n<p>Example: &#8220;The Java program, Test.java&#8221;<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">Test<\/span> <span class=\"token punctuation\">{<\/span>\r\n\r\n\t<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span>\r\n\r\n\t\t<span class=\"token class-name\">System<\/span><span class=\"token punctuation\">.<\/span>out<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\"Hello, World!\"<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\t\r\n\t<span class=\"token punctuation\">}<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<\/code><\/pre>\n<p>In this article, you will get a grasp of the significance of every element in the main function.<\/p>\n<h2>Syntax for Java Main Method<\/h2>\n<p>The structure of the main method is consistently:<\/p>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">public<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span>\r\n\t<span class=\"token comment\">\/\/ some code<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<\/code><\/pre>\n<p>You have the flexibility to modify only the name of the argument for the String array. For instance, you have the option to change args to myStringArgs. The argument for the String array can also be expressed as either String&#8230; args or String args[].<\/p>\n<h2>I only need one alternative:<\/h2>\n<p>&#8211; In regards to the aforementioned matter, I simply require one possible option.<\/p>\n<p>The main method should have a public access modifier for the JRE to access and execute it. When a method isn&#8217;t public, its access is limited. In the given code example, the main method lacks the public access modifier.<\/p>\n<div>One possible paraphrase could be &#8220;The file Test.java.&#8221;<\/div>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">Test<\/span> <span class=\"token punctuation\">{<\/span>\r\n\r\n\t<span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span>\r\n\r\n\t\t<span class=\"token class-name\">System<\/span><span class=\"token punctuation\">.<\/span>out<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\"Hello, World!\"<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\t\r\n\t<span class=\"token punctuation\">}<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<\/code><\/pre>\n<p>When you compile and execute the program, the mentioned error arises due to the main method not being made public, consequently making it inaccessible for the Java Runtime Environment (JRE) to locate.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">javac Test.java<\/li>\n<li data-prefix=\"$\"><span class=\"token function\">java<\/span> Test<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Error: Main method not found in class Test, please define the `main` method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<h2>unmoving or immobile<\/h2>\n<p>Upon the initiation of the Java program, the absence of a class object is evident. To enable the JVM to load the class into memory and invoke the main method before creating an instance of the class, the main method must possess the static modifier. In the aforementioned code example, the main method lacks the static modifier.<\/p>\n<div>One possible paraphrase could be:<br \/>\n&#8220;Java code file named Test.java.&#8221;<\/div>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">Test<\/span> <span class=\"token punctuation\">{<\/span>\r\n\r\n\t<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span>\r\n\r\n\t\t<span class=\"token class-name\">System<\/span><span class=\"token punctuation\">.<\/span>out<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\"Hello, World!\"<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\t\r\n\t<span class=\"token punctuation\">}<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<\/code><\/pre>\n<p>When you compile and execute the program, you encounter the error indicated below, which is caused due to the main method not being declared as static.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">javac Test.java<\/li>\n<li data-prefix=\"$\"><span class=\"token function\">java<\/span> Test<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Error: Main method is not static in class Test, please define the `main` method as: public static void main(String[] args)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<h2>No suggestions were given<\/h2>\n<p>Every Java method needs to specify the return type. The return type of the main method in Java is void, indicating that it does not return any value. Once the main method completes its execution, the Java program terminates, hence there is no requirement for a returned object. Here is an example code where the main method tries to return something despite having a void return type.<\/p>\n<div>\n<p>One available option for paraphrasing &#8220;Test.java&#8221; natively could be:<\/p>\n<p>The file named &#8220;Test.java&#8221;.<\/p>\n<\/div>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">Test<\/span> <span class=\"token punctuation\">{<\/span>\r\n\r\n\t<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span>\r\n\t\r\n\t\t<span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>\r\n\t<span class=\"token punctuation\">}<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<\/code><\/pre>\n<p>When the program is compiled, an error occurs because Java does not anticipate a return value when the return type is void.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">javac Test.java<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Test.java:5: error: incompatible types: unexpected return value return 0; ^ 1 error<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<h2>primary<\/h2>\n<p>The main method in Java is always named &#8220;main.&#8221; When a Java program begins execution, it always searches for the main method. The code example below demonstrates a scenario where the main method is renamed as &#8220;myMain.&#8221;<\/p>\n<div>Please provide the original content that needs to be paraphrased.<\/div>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">Test<\/span> <span class=\"token punctuation\">{<\/span>\r\n\r\n\t<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">myMain<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span>\r\n\r\n\t\t<span class=\"token class-name\">System<\/span><span class=\"token punctuation\">.<\/span>out<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\"Hello, World!\"<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n\t<span class=\"token punctuation\">}<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<\/code><\/pre>\n<p>Upon compiling and executing the program, the JRE encounters an error due to its inability to locate the main method within the class.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">javac Test.java<\/li>\n<li data-prefix=\"$\"><span class=\"token function\">java<\/span> Test<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>Error: Main method not found in class Test, please define the `main` method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<h2>args as an array of strings<\/h2>\n<p>The main method in Java accepts a single parameter which is an array of strings. Each string in the array represents a command line argument. These command line arguments can be used to modify the program&#8217;s behavior or pass information to it while it is running. The code example below demonstrates how to display the command line arguments that are provided when the program is executed.<\/p>\n<div>One possible paraphrase could be: &#8220;The file named Test.java.&#8221;<\/div>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">public<\/span> <span class=\"token keyword\">class<\/span> <span class=\"token class-name\">Test<\/span> <span class=\"token punctuation\">{<\/span>\r\n\r\n\t<span class=\"token keyword\">public<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span>\r\n\r\n    \t<span class=\"token keyword\">for<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">String<\/span> s <span class=\"token operator\">:<\/span> args<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span>\r\n\t\t<span class=\"token class-name\">System<\/span><span class=\"token punctuation\">.<\/span>out<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span>s<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n    \t<span class=\"token punctuation\">}<\/span>\r\n\t\r\n    <span class=\"token punctuation\">}<\/span>\r\n<span class=\"token punctuation\">}<\/span>\r\n<\/code><\/pre>\n<p>After compiling the program, when it is executed with multiple command line arguments separated by spaces, the terminal displays the printed arguments.<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">javac Test.java<\/li>\n<li data-prefix=\"$\"><span class=\"token function\">java<\/span> Test <span class=\"token number\">1<\/span> <span class=\"token number\">2<\/span> <span class=\"token number\">3<\/span> <span class=\"token string\">&#8220;Testing the main method&#8221;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/div>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>1 2 3 Testing the main method<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<h2>In conclusion, to sum up, to conclude, ultimately, all in all<\/h2>\n<p>After reading this article, you acquired knowledge about every element of the Java main method. Enhance your understanding with further Java tutorials.<\/p>\n<p>&nbsp;<\/p>\n<p>more\u00a0 tutorials<\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/ensuring-thread-safety-in-java-singleton-classes\/\" target=\"_blank\" rel=\"noopener\">Ensuring thread safety in Java Singleton Classes<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/how-to-integrate-playwright-for-react-application-component-testing\/\" target=\"_blank\" rel=\"noopener\">React Application Component Testing Integrate with Playwright<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/python-functions-ord-and-chr\/\" target=\"_blank\" rel=\"noopener\">The Python functions ord() and chr()<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/expect-the-easymock-void-method-to-have-its-last-call\/\" target=\"_blank\" rel=\"noopener\">EasyMock void method to have its last call.<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p><a class=\"LinkSuggestion__Link-sc-1gewdgc-4 cLBplk\" href=\"https:\/\/www.silicloud.com\/blog\/java-string-substring-method\/\" target=\"_blank\" rel=\"noopener\">Java String substring() method<span class=\"sc-gswNZR eASTkv\">(Opens in a new browser tab)<\/span><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following is an option for paraphrasing the given sentence natively: &#8220;To begin with, let&#8217;s delve into the introductory section.&#8221; The main method in Java is typically the initial method taught when beginning Java programming as it serves as the starting point for running a Java program. It can include code to execute or invoke [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-607","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The main method in Java - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Typically, more intricate programs have a class solely dedicated to housing the main method, often named Main.In the subsequent\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The main method in Java\" \/>\n<meta property=\"og:description\" content=\"Typically, more intricate programs have a class solely dedicated to housing the main method, often named Main.In the subsequent\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-21T13:04:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-13T15:43:32+00:00\" \/>\n<meta name=\"author\" content=\"Jackson Davis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:site\" content=\"@SiliCloudGlobal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jackson Davis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/\"},\"author\":{\"name\":\"Jackson Davis\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/55a10b8b0457c35884c25677889ad350\"},\"headline\":\"The main method in Java\",\"datePublished\":\"2022-07-21T13:04:50+00:00\",\"dateModified\":\"2024-03-13T15:43:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/\"},\"wordCount\":907,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/\",\"name\":\"The main method in Java - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\"},\"datePublished\":\"2022-07-21T13:04:50+00:00\",\"dateModified\":\"2024-03-13T15:43:32+00:00\",\"description\":\"Typically, more intricate programs have a class solely dedicated to housing the main method, often named Main.In the subsequent\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.silicloud.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The main method in Java\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"name\":\"Silicon Cloud Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\"},\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#organization\",\"name\":\"Silicon Cloud Blog\",\"url\":\"https:\/\/www.silicloud.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"contentUrl\":\"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png\",\"width\":1024,\"height\":1024,\"caption\":\"Silicon Cloud Blog\"},\"image\":{\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/SiliCloudGlobal\/\",\"https:\/\/twitter.com\/SiliCloudGlobal\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/55a10b8b0457c35884c25677889ad350\",\"name\":\"Jackson Davis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2fdb47d6df1226e92380d96973782572a97b0675d098bb914410dec348eb5d29?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2fdb47d6df1226e92380d96973782572a97b0675d098bb914410dec348eb5d29?s=96&d=mm&r=g\",\"caption\":\"Jackson Davis\"},\"url\":\"https:\/\/www.silicloud.com\/blog\/author\/jacksondavis\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"The main method in Java - Blog - Silicon Cloud","description":"Typically, more intricate programs have a class solely dedicated to housing the main method, often named Main.In the subsequent","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/","og_locale":"en_US","og_type":"article","og_title":"The main method in Java","og_description":"Typically, more intricate programs have a class solely dedicated to housing the main method, often named Main.In the subsequent","og_url":"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/","og_site_name":"Blog - Silicon Cloud","article_publisher":"https:\/\/www.facebook.com\/SiliCloudGlobal\/","article_published_time":"2022-07-21T13:04:50+00:00","article_modified_time":"2024-03-13T15:43:32+00:00","author":"Jackson Davis","twitter_card":"summary_large_image","twitter_creator":"@SiliCloudGlobal","twitter_site":"@SiliCloudGlobal","twitter_misc":{"Written by":"Jackson Davis","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/#article","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/"},"author":{"name":"Jackson Davis","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/55a10b8b0457c35884c25677889ad350"},"headline":"The main method in Java","datePublished":"2022-07-21T13:04:50+00:00","dateModified":"2024-03-13T15:43:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/"},"wordCount":907,"commentCount":0,"publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/","url":"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/","name":"The main method in Java - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/blog\/#website"},"datePublished":"2022-07-21T13:04:50+00:00","dateModified":"2024-03-13T15:43:32+00:00","description":"Typically, more intricate programs have a class solely dedicated to housing the main method, often named Main.In the subsequent","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/blog\/the-main-method-in-java-is-declared-as-public-static-void-mainstring-args\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.silicloud.com\/blog\/"},{"@type":"ListItem","position":2,"name":"The main method in Java"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/blog\/#website","url":"https:\/\/www.silicloud.com\/blog\/","name":"Silicon Cloud Blog","description":"","publisher":{"@id":"https:\/\/www.silicloud.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.silicloud.com\/blog\/#organization","name":"Silicon Cloud Blog","url":"https:\/\/www.silicloud.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","contentUrl":"https:\/\/www.silicloud.com\/blog\/wp-content\/uploads\/2023\/11\/EN-SILICON-Full.png","width":1024,"height":1024,"caption":"Silicon Cloud Blog"},"image":{"@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/SiliCloudGlobal\/","https:\/\/twitter.com\/SiliCloudGlobal"]},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/55a10b8b0457c35884c25677889ad350","name":"Jackson Davis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.silicloud.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2fdb47d6df1226e92380d96973782572a97b0675d098bb914410dec348eb5d29?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2fdb47d6df1226e92380d96973782572a97b0675d098bb914410dec348eb5d29?s=96&d=mm&r=g","caption":"Jackson Davis"},"url":"https:\/\/www.silicloud.com\/blog\/author\/jacksondavis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/comments?post=607"}],"version-history":[{"count":0,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/posts\/607\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/media?parent=607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/categories?post=607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/blog\/wp-json\/wp\/v2\/tags?post=607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}