CAN WE WRITE STATIC PUBLIC VOID INSTEAD OF PUBLIC STATIC VOID?

Mayank Tripathi

Total Post:807

Points:4035
Posted by  Mayank Tripathi
Java 
 648  View(s)
Ratings:
Rate this:
  1. Mayank Tripathi

    Post:807

    Points:4035
    Can we write static public void instead of public static void?

    Yes,  we can write,the change in sequence of modifiers are perfectly valid here. The code  will successfully complied and  runs properly. Placement of modifiers doesn't matter until the signature contains required keywords. 

    We can even add final keyword in this, will work and runs fine.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!