What happen when we write static public void instead of public static void?

What happen when we write static public void instead of public static void?

Hi,

What happen when we write static public void instead of public static void?

Thanks

View Answers

April 9, 2013 at 2:42 PM

Hi,

The program will compile first then run properly. For more details visit the reference site: http://www.roseindia.net/java/gettingstartedwithjava/public-static-void-main.shtml


April 10, 2013 at 2:56 PM

Hi , There is no order to declare the modifiers. Hence there is no differnet to declare the method by public static void or static public void.

Ads









Related Tutorials/Questions & Answers:
What happen when we write static public void instead of public static void?
public static void main
Advertisements
Why we are writting public static void main(String args[])?
Static keyword in public static void main
JAVA what is different between static block and public static void main(String a[]) method
Understanding public static void main function
What is Public static void main
STATIC
Can we replace main() with static block or with other static methods?
I'm getting an illgal start of expression error in my code for the public static boolean portion at the bottom... any ideas?
static
When will you define a method as static?
What is the importance of static variable?
static
static
static
What is static factory pattern?
Static
What is Static Website
What do you understand by private, protected and public?
What are the restriction imposed on a static method or a static block of code?
What is the difference between a static and a non-static inner class?
static keyword in java
static functions
can we inherit static method in java?
Can we declare a static variable inside a method?
Why is the main method declared static?
In Java, what's the difference between public, default, protected, and private?
non static variable cannot be referenced from static context
Static Variable
static methods

Ads