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
Joined: Jan 30, 2000
(a) and (f) are TRUE, IMO.
Tony Alicea Senior Java Web Application Developer, SCPJ2, SCWCD
Joined: Sep 23, 2002
What is the differenc between array of int references and array of int elements ?
Thanks,<br /> Arijit
Joined: Mar 22, 2002
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?
Joined: Jun 06, 2002
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)
Joined: May 05, 2000
ints are primitives and in Java primitives never have references.
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.