Java OCA OCP Practice Question 734


What is the correct parameter specification for the standard main method?

Select 2 options

  • A. void
  • B. String[] args
  • C. Strings args[]
  • D. String args
  • E. String args[]

Correct Options are  : B E


There is a no difference for args whether it is defined as String [] args or String args [].

There is an important difference in the way it is defined as illustrated by the following:

String [] sa1, sa2;

Here, both - sa1 and sa2 are String arrays.

String sa1[], sa2;

Here, only sa1 is a String array. sa2 is just a String.