Why is a method body filled with semicolons acceptable syntax?Why are exclamation marks used in Ruby methods?Is it possible to write a plain old java program that runs on android?java compilation: classname Vs classname with file-extensionCompile all files in src?Eclipse Plugin Get Code from Current Open FileIs it possible to write a program in Java without main() using JDK 1.7 or higher?Why the main method should be in staticError: Main method not found in class MovieDatabaseJava - Method executed prior to Default Constructor

A word that means "blending into a community too much"

What would prevent chimeras from reproducing with each other?

Getting UPS Power from One Room to Another

Proving that a Russian cryptographic standard is too structured

Live action TV show where High school Kids go into the virtual world and have to clear levels

Has there been a multiethnic Star Trek character?

Does putting salt first make it easier for attacker to bruteforce the hash?

Who won a Game of Bar Dice?

What aircraft was used as Air Force One for the flight between Southampton and Shannon?

Fermat's statement about the ancients: How serious was he?

Explanation for the two sentences(preposition)

Should I refuse to be named as co-author of a low quality paper?

How to make the letter "K" that denote Krylov space

Why AM-GM inequality showing different results?

Does a bank have to tell me if a check made out to me was cashed there?

Is it okay to have a sequel start immediately after the end of the first book?

How can I remove material from this wood beam?

A map of non-pathological topology?

Possible runaway argument using circuitikz

C++ logging library

Did Apple bundle a specific monitor with the Apple II+ for schools?

2019 gold coins to share

Can you make an identity from this product?

Why are MBA programs closing in the United States?



Why is a method body filled with semicolons acceptable syntax?


Why are exclamation marks used in Ruby methods?Is it possible to write a plain old java program that runs on android?java compilation: classname Vs classname with file-extensionCompile all files in src?Eclipse Plugin Get Code from Current Open FileIs it possible to write a program in Java without main() using JDK 1.7 or higher?Why the main method should be in staticError: Main method not found in class MovieDatabaseJava - Method executed prior to Default Constructor






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








4















public static void main(String[] args) 
System.out.println("World Hello!");;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;
;;;;;;;;;
;;;;;;;
;;;;;;;;;;;;;;
;;;;;



The normal person is me wants to say: "What are all of those semicolons doing there!?"










share|improve this question






























    4















    public static void main(String[] args) 
    System.out.println("World Hello!");;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;;;;;
    ;;;;;;;;;
    ;;;;;;;
    ;;;;;;;;;;;;;;
    ;;;;;



    The normal person is me wants to say: "What are all of those semicolons doing there!?"










    share|improve this question


























      4












      4








      4








      public static void main(String[] args) 
      System.out.println("World Hello!");;;;;;;;;;;;;;
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;;;;;;
      ;;;;;;;;;
      ;;;;;;;
      ;;;;;;;;;;;;;;
      ;;;;;



      The normal person is me wants to say: "What are all of those semicolons doing there!?"










      share|improve this question
















      public static void main(String[] args) 
      System.out.println("World Hello!");;;;;;;;;;;;;;
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      ;;;;;;
      ;;;;;;;;;
      ;;;;;;;
      ;;;;;;;;;;;;;;
      ;;;;;



      The normal person is me wants to say: "What are all of those semicolons doing there!?"







      java methods






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 20:36









      double-beep

      3,14251632




      3,14251632










      asked Apr 1 '14 at 23:01









      ZeratasZeratas

      4952931




      4952931






















          3 Answers
          3






          active

          oldest

          votes


















          11














          Because a simple semicolon next to another semicolon is an empty statement. So, lot of semi colons next to each other are lot of empty statements. It compiles and runs with no problems.






          share|improve this answer























          • So if you wanted to, you could have an infinite amount of empty statements?

            – Zeratas
            Apr 1 '14 at 23:03






          • 2





            @Sempus yes, you can. But as you noted in your question content, it is kinda ridiculous.

            – Luiggi Mendoza
            Apr 1 '14 at 23:03






          • 2





            There's nothing infinite in computing and in computers.

            – peter.petrov
            Apr 1 '14 at 23:03











          • @Sempus I think there's a limit to how long a method can be.

            – Daniel Kaplan
            Apr 1 '14 at 23:04






          • 1





            @peter.petrov while(true)?

            – Luiggi Mendoza
            Apr 1 '14 at 23:05


















          7














          According to Oracle Java Language Specification:




          An empty statement does nothing.



          EmptyStatement:
          ;


          Execution of an empty statement always completes normally.




          Since the language it self allows consecutive semicolons, the compiler will not produce an error.



          You could also check the bytecode to see what is happening, the code with a lot of ";" :



          // Stack: 1, Locals: 1
          public Duh1();
          0 aload_0 [this]
          1 invokespecial java.lang.Object() [8]
          4 return
          Line numbers:
          [pc: 0, line: 3]
          Local variable table:
          [pc: 0, pc: 5] local: this index: 0 type: Duh

          // Method descriptor #15 ([Ljava/lang/String;)V
          // Stack: 2, Locals: 1
          public static void main(java.lang.String[] args);
          0 getstatic java.lang.System.out : java.io.PrintStream [16]
          3 ldc <String "World Hello!"> [22]
          5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]
          8 return
          Line numbers:
          [pc: 0, line: 5]
          [pc: 8, line: 15]
          Local variable table:
          [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]

          Line numbers:
          [pc: 0, line: 5]
          [pc: 8, line: 6]


          and the code with only 1 ";" :



          // Method descriptor #6 ()V
          // Stack: 1, Locals: 1
          public Duh2();
          0 aload_0 [this]
          1 invokespecial java.lang.Object() [8]
          4 return
          Line numbers:
          [pc: 0, line: 3]
          Local variable table:
          [pc: 0, pc: 5] local: this index: 0 type: Duh2

          // Method descriptor #15 ([Ljava/lang/String;)V
          // Stack: 2, Locals: 1
          public static void main(java.lang.String[] args);
          0 getstatic java.lang.System.out : java.io.PrintStream [16]
          3 ldc <String "World Hello!"> [22]
          5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]
          8 return
          Line numbers:
          [pc: 0, line: 5]
          [pc: 8, line: 6]
          Local variable table:
          [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]

          Line numbers:
          [pc: 0, line: 5]
          [pc: 8, line: 6]


          As you can check the bytecode is exactly the same for both version with single ";" and consecutive multiple ";".






          share|improve this answer
































            0














            Because a semi-colon only symbolises a newline. This means that we can simpily write:



            cout << "Hello Worldn"; return 0;


            Without even writing on a newline. Keep in mind its more tidy to write on seperate lines.






            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f22798529%2fwhy-is-a-method-body-filled-with-semicolons-acceptable-syntax%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              11














              Because a simple semicolon next to another semicolon is an empty statement. So, lot of semi colons next to each other are lot of empty statements. It compiles and runs with no problems.






              share|improve this answer























              • So if you wanted to, you could have an infinite amount of empty statements?

                – Zeratas
                Apr 1 '14 at 23:03






              • 2





                @Sempus yes, you can. But as you noted in your question content, it is kinda ridiculous.

                – Luiggi Mendoza
                Apr 1 '14 at 23:03






              • 2





                There's nothing infinite in computing and in computers.

                – peter.petrov
                Apr 1 '14 at 23:03











              • @Sempus I think there's a limit to how long a method can be.

                – Daniel Kaplan
                Apr 1 '14 at 23:04






              • 1





                @peter.petrov while(true)?

                – Luiggi Mendoza
                Apr 1 '14 at 23:05















              11














              Because a simple semicolon next to another semicolon is an empty statement. So, lot of semi colons next to each other are lot of empty statements. It compiles and runs with no problems.






              share|improve this answer























              • So if you wanted to, you could have an infinite amount of empty statements?

                – Zeratas
                Apr 1 '14 at 23:03






              • 2





                @Sempus yes, you can. But as you noted in your question content, it is kinda ridiculous.

                – Luiggi Mendoza
                Apr 1 '14 at 23:03






              • 2





                There's nothing infinite in computing and in computers.

                – peter.petrov
                Apr 1 '14 at 23:03











              • @Sempus I think there's a limit to how long a method can be.

                – Daniel Kaplan
                Apr 1 '14 at 23:04






              • 1





                @peter.petrov while(true)?

                – Luiggi Mendoza
                Apr 1 '14 at 23:05













              11












              11








              11







              Because a simple semicolon next to another semicolon is an empty statement. So, lot of semi colons next to each other are lot of empty statements. It compiles and runs with no problems.






              share|improve this answer













              Because a simple semicolon next to another semicolon is an empty statement. So, lot of semi colons next to each other are lot of empty statements. It compiles and runs with no problems.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 1 '14 at 23:02









              Luiggi MendozaLuiggi Mendoza

              75.2k10109232




              75.2k10109232












              • So if you wanted to, you could have an infinite amount of empty statements?

                – Zeratas
                Apr 1 '14 at 23:03






              • 2





                @Sempus yes, you can. But as you noted in your question content, it is kinda ridiculous.

                – Luiggi Mendoza
                Apr 1 '14 at 23:03






              • 2





                There's nothing infinite in computing and in computers.

                – peter.petrov
                Apr 1 '14 at 23:03











              • @Sempus I think there's a limit to how long a method can be.

                – Daniel Kaplan
                Apr 1 '14 at 23:04






              • 1





                @peter.petrov while(true)?

                – Luiggi Mendoza
                Apr 1 '14 at 23:05

















              • So if you wanted to, you could have an infinite amount of empty statements?

                – Zeratas
                Apr 1 '14 at 23:03






              • 2





                @Sempus yes, you can. But as you noted in your question content, it is kinda ridiculous.

                – Luiggi Mendoza
                Apr 1 '14 at 23:03






              • 2





                There's nothing infinite in computing and in computers.

                – peter.petrov
                Apr 1 '14 at 23:03











              • @Sempus I think there's a limit to how long a method can be.

                – Daniel Kaplan
                Apr 1 '14 at 23:04






              • 1





                @peter.petrov while(true)?

                – Luiggi Mendoza
                Apr 1 '14 at 23:05
















              So if you wanted to, you could have an infinite amount of empty statements?

              – Zeratas
              Apr 1 '14 at 23:03





              So if you wanted to, you could have an infinite amount of empty statements?

              – Zeratas
              Apr 1 '14 at 23:03




              2




              2





              @Sempus yes, you can. But as you noted in your question content, it is kinda ridiculous.

              – Luiggi Mendoza
              Apr 1 '14 at 23:03





              @Sempus yes, you can. But as you noted in your question content, it is kinda ridiculous.

              – Luiggi Mendoza
              Apr 1 '14 at 23:03




              2




              2





              There's nothing infinite in computing and in computers.

              – peter.petrov
              Apr 1 '14 at 23:03





              There's nothing infinite in computing and in computers.

              – peter.petrov
              Apr 1 '14 at 23:03













              @Sempus I think there's a limit to how long a method can be.

              – Daniel Kaplan
              Apr 1 '14 at 23:04





              @Sempus I think there's a limit to how long a method can be.

              – Daniel Kaplan
              Apr 1 '14 at 23:04




              1




              1





              @peter.petrov while(true)?

              – Luiggi Mendoza
              Apr 1 '14 at 23:05





              @peter.petrov while(true)?

              – Luiggi Mendoza
              Apr 1 '14 at 23:05













              7














              According to Oracle Java Language Specification:




              An empty statement does nothing.



              EmptyStatement:
              ;


              Execution of an empty statement always completes normally.




              Since the language it self allows consecutive semicolons, the compiler will not produce an error.



              You could also check the bytecode to see what is happening, the code with a lot of ";" :



              // Stack: 1, Locals: 1
              public Duh1();
              0 aload_0 [this]
              1 invokespecial java.lang.Object() [8]
              4 return
              Line numbers:
              [pc: 0, line: 3]
              Local variable table:
              [pc: 0, pc: 5] local: this index: 0 type: Duh

              // Method descriptor #15 ([Ljava/lang/String;)V
              // Stack: 2, Locals: 1
              public static void main(java.lang.String[] args);
              0 getstatic java.lang.System.out : java.io.PrintStream [16]
              3 ldc <String "World Hello!"> [22]
              5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]
              8 return
              Line numbers:
              [pc: 0, line: 5]
              [pc: 8, line: 15]
              Local variable table:
              [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]

              Line numbers:
              [pc: 0, line: 5]
              [pc: 8, line: 6]


              and the code with only 1 ";" :



              // Method descriptor #6 ()V
              // Stack: 1, Locals: 1
              public Duh2();
              0 aload_0 [this]
              1 invokespecial java.lang.Object() [8]
              4 return
              Line numbers:
              [pc: 0, line: 3]
              Local variable table:
              [pc: 0, pc: 5] local: this index: 0 type: Duh2

              // Method descriptor #15 ([Ljava/lang/String;)V
              // Stack: 2, Locals: 1
              public static void main(java.lang.String[] args);
              0 getstatic java.lang.System.out : java.io.PrintStream [16]
              3 ldc <String "World Hello!"> [22]
              5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]
              8 return
              Line numbers:
              [pc: 0, line: 5]
              [pc: 8, line: 6]
              Local variable table:
              [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]

              Line numbers:
              [pc: 0, line: 5]
              [pc: 8, line: 6]


              As you can check the bytecode is exactly the same for both version with single ";" and consecutive multiple ";".






              share|improve this answer





























                7














                According to Oracle Java Language Specification:




                An empty statement does nothing.



                EmptyStatement:
                ;


                Execution of an empty statement always completes normally.




                Since the language it self allows consecutive semicolons, the compiler will not produce an error.



                You could also check the bytecode to see what is happening, the code with a lot of ";" :



                // Stack: 1, Locals: 1
                public Duh1();
                0 aload_0 [this]
                1 invokespecial java.lang.Object() [8]
                4 return
                Line numbers:
                [pc: 0, line: 3]
                Local variable table:
                [pc: 0, pc: 5] local: this index: 0 type: Duh

                // Method descriptor #15 ([Ljava/lang/String;)V
                // Stack: 2, Locals: 1
                public static void main(java.lang.String[] args);
                0 getstatic java.lang.System.out : java.io.PrintStream [16]
                3 ldc <String "World Hello!"> [22]
                5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]
                8 return
                Line numbers:
                [pc: 0, line: 5]
                [pc: 8, line: 15]
                Local variable table:
                [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]

                Line numbers:
                [pc: 0, line: 5]
                [pc: 8, line: 6]


                and the code with only 1 ";" :



                // Method descriptor #6 ()V
                // Stack: 1, Locals: 1
                public Duh2();
                0 aload_0 [this]
                1 invokespecial java.lang.Object() [8]
                4 return
                Line numbers:
                [pc: 0, line: 3]
                Local variable table:
                [pc: 0, pc: 5] local: this index: 0 type: Duh2

                // Method descriptor #15 ([Ljava/lang/String;)V
                // Stack: 2, Locals: 1
                public static void main(java.lang.String[] args);
                0 getstatic java.lang.System.out : java.io.PrintStream [16]
                3 ldc <String "World Hello!"> [22]
                5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]
                8 return
                Line numbers:
                [pc: 0, line: 5]
                [pc: 8, line: 6]
                Local variable table:
                [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]

                Line numbers:
                [pc: 0, line: 5]
                [pc: 8, line: 6]


                As you can check the bytecode is exactly the same for both version with single ";" and consecutive multiple ";".






                share|improve this answer



























                  7












                  7








                  7







                  According to Oracle Java Language Specification:




                  An empty statement does nothing.



                  EmptyStatement:
                  ;


                  Execution of an empty statement always completes normally.




                  Since the language it self allows consecutive semicolons, the compiler will not produce an error.



                  You could also check the bytecode to see what is happening, the code with a lot of ";" :



                  // Stack: 1, Locals: 1
                  public Duh1();
                  0 aload_0 [this]
                  1 invokespecial java.lang.Object() [8]
                  4 return
                  Line numbers:
                  [pc: 0, line: 3]
                  Local variable table:
                  [pc: 0, pc: 5] local: this index: 0 type: Duh

                  // Method descriptor #15 ([Ljava/lang/String;)V
                  // Stack: 2, Locals: 1
                  public static void main(java.lang.String[] args);
                  0 getstatic java.lang.System.out : java.io.PrintStream [16]
                  3 ldc <String "World Hello!"> [22]
                  5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]
                  8 return
                  Line numbers:
                  [pc: 0, line: 5]
                  [pc: 8, line: 15]
                  Local variable table:
                  [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]

                  Line numbers:
                  [pc: 0, line: 5]
                  [pc: 8, line: 6]


                  and the code with only 1 ";" :



                  // Method descriptor #6 ()V
                  // Stack: 1, Locals: 1
                  public Duh2();
                  0 aload_0 [this]
                  1 invokespecial java.lang.Object() [8]
                  4 return
                  Line numbers:
                  [pc: 0, line: 3]
                  Local variable table:
                  [pc: 0, pc: 5] local: this index: 0 type: Duh2

                  // Method descriptor #15 ([Ljava/lang/String;)V
                  // Stack: 2, Locals: 1
                  public static void main(java.lang.String[] args);
                  0 getstatic java.lang.System.out : java.io.PrintStream [16]
                  3 ldc <String "World Hello!"> [22]
                  5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]
                  8 return
                  Line numbers:
                  [pc: 0, line: 5]
                  [pc: 8, line: 6]
                  Local variable table:
                  [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]

                  Line numbers:
                  [pc: 0, line: 5]
                  [pc: 8, line: 6]


                  As you can check the bytecode is exactly the same for both version with single ";" and consecutive multiple ";".






                  share|improve this answer















                  According to Oracle Java Language Specification:




                  An empty statement does nothing.



                  EmptyStatement:
                  ;


                  Execution of an empty statement always completes normally.




                  Since the language it self allows consecutive semicolons, the compiler will not produce an error.



                  You could also check the bytecode to see what is happening, the code with a lot of ";" :



                  // Stack: 1, Locals: 1
                  public Duh1();
                  0 aload_0 [this]
                  1 invokespecial java.lang.Object() [8]
                  4 return
                  Line numbers:
                  [pc: 0, line: 3]
                  Local variable table:
                  [pc: 0, pc: 5] local: this index: 0 type: Duh

                  // Method descriptor #15 ([Ljava/lang/String;)V
                  // Stack: 2, Locals: 1
                  public static void main(java.lang.String[] args);
                  0 getstatic java.lang.System.out : java.io.PrintStream [16]
                  3 ldc <String "World Hello!"> [22]
                  5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]
                  8 return
                  Line numbers:
                  [pc: 0, line: 5]
                  [pc: 8, line: 15]
                  Local variable table:
                  [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]

                  Line numbers:
                  [pc: 0, line: 5]
                  [pc: 8, line: 6]


                  and the code with only 1 ";" :



                  // Method descriptor #6 ()V
                  // Stack: 1, Locals: 1
                  public Duh2();
                  0 aload_0 [this]
                  1 invokespecial java.lang.Object() [8]
                  4 return
                  Line numbers:
                  [pc: 0, line: 3]
                  Local variable table:
                  [pc: 0, pc: 5] local: this index: 0 type: Duh2

                  // Method descriptor #15 ([Ljava/lang/String;)V
                  // Stack: 2, Locals: 1
                  public static void main(java.lang.String[] args);
                  0 getstatic java.lang.System.out : java.io.PrintStream [16]
                  3 ldc <String "World Hello!"> [22]
                  5 invokevirtual java.io.PrintStream.println(java.lang.String) : void [24]
                  8 return
                  Line numbers:
                  [pc: 0, line: 5]
                  [pc: 8, line: 6]
                  Local variable table:
                  [pc: 0, pc: 9] local: args index: 0 type: java.lang.String[]

                  Line numbers:
                  [pc: 0, line: 5]
                  [pc: 8, line: 6]


                  As you can check the bytecode is exactly the same for both version with single ";" and consecutive multiple ";".







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 5 '14 at 16:52

























                  answered Apr 1 '14 at 23:05









                  dreamcrashdreamcrash

                  13.9k134569




                  13.9k134569





















                      0














                      Because a semi-colon only symbolises a newline. This means that we can simpily write:



                      cout << "Hello Worldn"; return 0;


                      Without even writing on a newline. Keep in mind its more tidy to write on seperate lines.






                      share|improve this answer



























                        0














                        Because a semi-colon only symbolises a newline. This means that we can simpily write:



                        cout << "Hello Worldn"; return 0;


                        Without even writing on a newline. Keep in mind its more tidy to write on seperate lines.






                        share|improve this answer

























                          0












                          0








                          0







                          Because a semi-colon only symbolises a newline. This means that we can simpily write:



                          cout << "Hello Worldn"; return 0;


                          Without even writing on a newline. Keep in mind its more tidy to write on seperate lines.






                          share|improve this answer













                          Because a semi-colon only symbolises a newline. This means that we can simpily write:



                          cout << "Hello Worldn"; return 0;


                          Without even writing on a newline. Keep in mind its more tidy to write on seperate lines.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 2 '14 at 0:59









                          KinggadinoKinggadino

                          349




                          349



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f22798529%2fwhy-is-a-method-body-filled-with-semicolons-acceptable-syntax%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                              Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                              Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript