English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

can an array in java be declared like this?
int[5] a1=new int[];

2007-02-12 18:54:35 · 3 answers · asked by IT-Innovating Trends 1 in Computers & Internet Programming & Design

3 answers

Well i suppose you know the answer to that as well (NONONO), but i will explain it anyways.
Take int a=5; as an example
clearly u do not define the values at the start of the statement
since its logically wrong ( variable(int a)=value(5) )
so
int[] a1=new int[5]; is the correct syntax

2007-02-12 20:37:40 · answer #1 · answered by Geinius 3 · 0 0

int m,n, a[][]; study fee for m and n a=new int[m][n]; yet another attitude int [][] records=new int[10][]; for(i=0;i

2016-10-02 01:39:26 · answer #2 · answered by ? 4 · 0 0

NO.

2007-02-12 19:02:30 · answer #3 · answered by rajesh v 2 · 1 0

fedest.com, questions and answers