File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Reference" Watch "Reference" New topic



Joined: Mar 01, 2000
Posts: 25
What is the difference between int[] a; and int a[];
a)No difference.
b)First one will give compilation error.
c)Second one will give compilation error.
d)First one represents array of int references.
e)Second one represents array of int references.
f)both represents array of int elements.
What is the answer??
My answers- a,d,e
Tony Alicea

Joined: Jan 30, 2000
Posts: 3226
are TRUE, IMO.

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Arijit Ghosh

Joined: Sep 23, 2002
Posts: 22
What is the differenc between array of int references and array of int elements ?

Thanks,<br /> Arijit
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Originally posted by Arijit:
What is the differenc between array of int references and array of int elements ?

I don't understand the question. Can you give a specfic example?
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
Do you mean the difference between int[] and Integer[] ?
The first is an array of (primitive) ints, while the second is an array of references to Integer objects (wrappers for ints).

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
ints are primitives and in Java primitives never have references.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
Welcome to Javaranch
We'd like you to read the Javaranch Naming Policy and change your publicly displayed name (change it here) to comply with our unique rule. Thank you.
PS: Quote from the naming policy:

For your publicly displayed name, use a first name, a space, and a last name. Obviously fictitious names or improperly formatted names may be locked out.

[Blog] [Blogroll] [My Reviews] My Linked In
I agree. Here's the link:
subject: Reference
It's not a secret anymore!