Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8770669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:36:07+00:00 2026-06-13T17:36:07+00:00

I am currently teaching students as a tutor programming conventions. I’ve told them that

  • 0

I am currently teaching students as a tutor programming conventions. I’ve told them that they can find most conventions in the Oracle Code Conventions.

In my last tutorial a student asked if:

public static void main(String args[])

or

public static void main(String[] args)

is written by convention or if there is a difference. I have never seen the first version before, so I’m very sure that the second one is a convention. But I don’t have a source for that.

Can you give me a source (preferably from oracle, like the page I’ve linked above) that makes clear which of both is convention?

Equivalence of both expressions

I know that both expressions are equivalent:

The JLS 7, p. 292 states:

An array type is written as the name of an element type followed 
by some number of empty pairs of square brackets []. 

but also on p. 293:

The [] may appear as part of the type at the beginning of the declaration, 
or as part of the declarator for a particular variable, or both.

For example:
    byte[] rowvector, colvector, matrix[];
This declaration is equivalent to:
    byte rowvector[], colvector[], matrix[][];

But this doesn’t help for the convention-quesiton.

So they are identical (not specs, but here is a source).
They produce the same bytecode in a small example, so I’m very sure that they are also identical in praxis.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:36:08+00:00Added an answer on June 13, 2026 at 5:36 pm

    This is not from Oracle but I think it will help.

    It is from Kathy Sierra’s book SCJP Sun Certified Programmer for Java 6

    int[] key;
    int key [];
    

    When declaring an array reference, you should always put the array brackets
    immediately after the declared type, rather than after the identifier (variable
    name). That way, anyone reading the code can easily tell that, for example, key is a
    reference to an int array object, and not an int primitive.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on a self-teaching exercise in programming in C# to make an
I've been teaching myself functional programming, and I'm currently writing different higher order functions
I'm currently teaching myself objective C. I've gone through the tutorials, but I find
I am teaching myself CUDA with the programming guide that CUDA offers. For practice,
I'm currently teaching myself python (coming from no programming background, but a lot of
I am currently teaching myself iPhone programming and working on solving assignment 2 [PDF]
I'm implementing an automatic evaluator for a course I'm currently teaching. The overall idea
Currently, I am writing a MiddleWare application that synchronizes information between and accounting application
I'm currently teaching an employee ECMA script as it is needed in maintaining a
Hey all, I'm currently teaching myself Objective C and I'm kind of stuck. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.