-
October 12th, 2011, 04:27 PM
#1
Creating an array *help*
I am having trouble creating an array.
Code:
String[] read2;
read2 = new read2[br];
Error:
Code:
Test2.java:53: error: cannot find symbol
read2 = new read2[br];
^
symbol: class read2
location: class Test2
Test2.java:53: error: cannot find symbol
read2 = new read2[br];
^
symbol: variable br
location: class Test2
Last edited by kolt007; October 12th, 2011 at 04:39 PM.
-
October 12th, 2011, 05:14 PM
#2
Re: Creating an array *help*
Is that read2 a class?
if it is, make sure that the class must be in a same folder with the one where u r creating an array, or you can import the read2 class.
-
October 12th, 2011, 07:46 PM
#3
Re: Creating an array *help*
-
October 13th, 2011, 03:43 AM
#4
Re: Creating an array *help*
Are you trying to create an array initialised with the string "br" in it ???
Code:
String[] read2;
read2 = new String[] {"br"};
or
Code:
String[] read2 = new String[] {"br"};
[code]
-
October 13th, 2011, 01:00 PM
#5
Re: Creating an array *help*
nevermind I think what I was trying is impossible I was trying to put,
BufferedReader br = new... etc
into an array.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|