Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What will happen if you change the sequence of keywords(public/static/void) in main method?

user-image
Question added by himanshu mittal
Date Posted: 2013/06/25
gagandeep kaur gagan
by gagandeep kaur gagan , internship , hcl-cdc

if we change sequence public and static there is no effect on excution bu if we write public void static then exceprion can be occur

Daanish Rumani
by Daanish Rumani , Product Manager , Publicis Sapient

You cannot do that for any method.
It shall result in a compile error.
I mean you cannot expect the following code to compile void public static myMethod() { }

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.