wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Reference" Watch "Reference" New topic
Author

Reference

Divakar
Greenhorn

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
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3222
    
    5
(a)
and
(f)
are TRUE, IMO.


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

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
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Divakar,
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.


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reference
 
Similar Threads
Sierra Bates SCJP 6 Ch. 3 No. 3
Sun Cirtification
Generic Method Infer Type Parameter
Constructing multidimensional arrays
Difference between array of references and single reference