• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Fill in the blank

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In an Java application program, what are the appropriate modifiers and return types for the main method declaration ? Write down the keywords in the correct order, choosing the following keyword list.
private protected public abstract static boolean void synchronized final Object native transient
The answer is public static void main(String[] args), though String[] args not in the above list. How Exam consider this answer ?.
In case if we say public static void main(String args[]), will the Exam consider this one is correct ?
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you copied the question correctly, it doesn't ask about argument list, only about return type and access modifier. So the answer is <CODE>public static void main</CODE> OR <CODE>static public void main</CODE>.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes...Tony, I copied exact and surprised to see Bill Brogden includes String[] args in his answer.
Again....
Hoping that Exam will consider both public static void main and static public void main as correct answer.
 
Tony Alicea
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Brogden corrected that a long time ago. It is in his errata Web page. It is critical to get the errata for tech books. Brogden is very good at maintaining one.
 
Tony Alicea
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CORRECTION TO MY POST ABOVE:
The correct answer is
<CODE>public static void</CODE>
OR
<CODE>static public void</CODE>
main is not in the given list.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic