| Author |
Reg array initialization
|
Pradeep Kumar
Ranch Hand
Joined: Sep 11, 2007
Posts: 77
|
|
What is the differnece between the below two declarations. As results of both the statements are the same.Apart from that are there any other differences. int[] aray1 = {1,2,3,4,5,5}; int[] aray2 =new int[]{1,2,3,4}; Regards, Pradeep
|
SCJP 1.6
|
 |
Stan James
(instanceof Sidekick)
Ranch Hand
Joined: Jan 29, 2003
Posts: 8791
|
|
Nope, no difference we need to think about. Some of us wish we could use the first syntax anyplace an array is needed instead of only in initializations.
|
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56215
|
|
"PradeepKumar", please check your private messages for an important message from me. [ October 06, 2007: Message edited by: Bear Bibeault ]
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Reg array initialization
|
|
|