| Author |
Simple java error need some advice please
|
andy yup
Greenhorn
Joined: Nov 19, 2009
Posts: 1
|
|
this might be very basic, but literally today is my first day trying to learn java.
ok here is my code.
I have no idea what I did wrong, its probley really basic cause im java stupid.
but im getting this error.
(filename/directory) <identifier> expected
Public static void main (args[]) {
Then theres a little carrot(^) underneath the 2nd parenthese in (args[])
|
 |
Siva Masilamani
Ranch Hand
Joined: Sep 19, 2008
Posts: 377
|
|
public static void main (args[])
When passing argument it should know the argument type.
in your case the argument to the main method should be String array.
So it should be like this
|
SCJP 6,SCWCD 5,SCBCD 5
Failure is not an option.
|
 |
Al Fraelich
Greenhorn
Joined: May 25, 2009
Posts: 20
|
|
Shouldn't the string be the arryay like this
public static void main(String[] args)
I could be wrong, but that's the way I have always done it, but i'm learning too.
|
 |
Siva Masilamani
Ranch Hand
Joined: Sep 19, 2008
Posts: 377
|
|
Both are same but your's is more clean and clear and recommended
But again both are valid.
|
 |
 |
|
|
subject: Simple java error need some advice please
|
|
|