|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming | |
(java) why wont this compile?
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | |||||||||||||
|
nVidia Enthusiast
|
public class pc
{ public static void main(String[] args) { String[] data = new String[5]; data[0] = "hex"; data[1] = "dssdfsk"; data[2] = "dsfafd"; data[3] = "dafsad"; data[4] = "dadfad"; } } I am a noob...(there I'll admit it) ![]()
__________________
"We are all prophets, that is why we make so many mistakes" "One who wears a mask wants to become someone else one who wears a mask somewhere other than the face wants to become many" "The truth is a lie" "There are only a few free people in the world, the insane"
Last edited by ModeX : 03-23-07 at 08:43 PM. |
|||||||||||||
|
|
|
|
|
#2 (permalink) | ||||||||||||||
|
Intel Overclocker
|
I copied and pasted, and it compiles fine for me. what are you using for editing, compiling and running?
__________________
Quote:
SLi Zone PSU listing- check to see if your PSU is SLi certified. BF2 stats BF2142 stats My Guide to BF2 Unlocks
|
||||||||||||||
|
|
|
|
#3 (permalink) | |||||||||||||
|
nVidia Enthusiast
|
I'm using netbeans IDE every time I try to compile it says ']' <identifier> expected, and it won't compile.....hmmmm wonder why..
__________________
"We are all prophets, that is why we make so many mistakes" "One who wears a mask wants to become someone else one who wears a mask somewhere other than the face wants to become many" "The truth is a lie" "There are only a few free people in the world, the insane"
|
|||||||||||||
|
|
|
|
|
#4 (permalink) | ||||||||||||||
|
Rabble rabble
Join Date: Oct 2006
Location: 29 Palms(stumps), CA
Posts: 2,305
Rep: 134
![]() ![]() Unique Rep: 108
Trader Rating: 3
|
Try;
String[] data = {" ", " ", " ", " ", " "}; and then continue on with your code. As for a compiler I suggest BlueJ. I use it at school and at home and it rocks.
__________________
Quote:
Overclock.net TOS: Live it. Love it.![]() THE CHEVY Owners CLUB!!!
|
||||||||||||||
|
|
|
|
#5 (permalink) | ||||||||||||||
|
nVidia Enthusiast
|
Quote:
Sure I'll give blue a try ![]()
__________________
"We are all prophets, that is why we make so many mistakes" "One who wears a mask wants to become someone else one who wears a mask somewhere other than the face wants to become many" "The truth is a lie" "There are only a few free people in the world, the insane"
|
||||||||||||||
|
|
|
|
|
#6 (permalink) | ||||||||||||||
|
Intel Overclocker
|
yeah, i'm using BlueJ. It's plain and simple, great for learning.
__________________
Quote:
SLi Zone PSU listing- check to see if your PSU is SLi certified. BF2 stats BF2142 stats My Guide to BF2 Unlocks
|
||||||||||||||
|
|
|
|
#7 (permalink) | ||||||||||||
|
110100001101001111000
|
What version of Netbeans do you have? I'm on 5.5 on that compiles just fine for me.
__________________
|
||||||||||||
|
|
|
|
#8 (permalink) | |||||||||||||
|
PC Gamer
|
I use JGrasp, and it works fine.
|
|||||||||||||
|
|
|
|
|
#9 (permalink) | |||||||||||||
|
nVidia Enthusiast
|
I'm using 5.5, when you say it compiles fine are you you using my example, because if you are ***?!?!?
EDIT:mmmm... as I said before I'm a noob, are arrays limited to the 1st Class?
__________________
"We are all prophets, that is why we make so many mistakes" "One who wears a mask wants to become someone else one who wears a mask somewhere other than the face wants to become many" "The truth is a lie" "There are only a few free people in the world, the insane"
Last edited by ModeX : 03-25-07 at 12:20 AM. |
|||||||||||||
|
|
|
|
|
#10 (permalink) | |||||||||||||||
|
Photography nut
![]() |
Quote:
Code:
package javaapplication1;
public class Main {
public static void main(String[] args) {
String[] data = new String[5];
data[0] = "hex";
data[1] = "dssdfsk";
data[2] = "dsfafd";
data[3] = "dafsad";
data[4] = "dadfad";
for (int i=0;i<5;i++)
System.out.println(data[i]);
}
}
__________________
"UNIX was never designed to keep people from doing stupid things, because that policy would also keep them from doing clever things." - Doug Gwyn Try out the latest Programming Challenge Quote:
CPU-Z Validation @ 2.97-prime95 stable 16 hours @ 1.48v Proof | CPU-Z Validation @ 3.15 Getting Mouse Side Buttons to work in Linux, Compile a custom Kernel, More
|
|||||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|