Results 1 to 11 of 11
- 07-03-2011, 04:59 PM #1
Member
- Join Date
- Jul 2011
- Posts
- 1
- Rep Power
- 0
This is an error? public static void main(String args[])
This is my code written in Eclipse:
This cannot be executed as it contains an error? I have it from the Java programming tutorials on youtube from 2009 (YouTube - ‪Java Programming Tutorial - 5 - Variables‬‏)Java Code:class apples{ public static void main(String args[]){ System.out.println("Hello"); } }
Why? I suppose Java has been updated and has to be written differently?
-
- 07-03-2011, 06:11 PM #3
Member
- Join Date
- Sep 2010
- Posts
- 9
- Rep Power
- 0
move the square brackets no?
bc the data type of args is a String[], so try that? or does it work both ways....hmm
- 07-03-2011, 06:34 PM #4
this is the error
Exception in thread "main" java.lang.NoClassDeffoundError:
-
- 07-04-2011, 06:29 AM #6
@ Fubarable: yes, this is followed by classname.
- 07-04-2011, 07:17 AM #7
What Fubar was asking was your class is called apples. Is it saved in apples.java?
Also do you compile it with javac apples.java? Do you run it with java apples?
- 07-04-2011, 07:24 AM #8
Copy and paste the error message. All of it.
db
- 07-04-2011, 04:08 PM #9
i did the same what u r saying. still, it's compiles but don't run.
- 07-04-2011, 06:02 PM #10
Member
- Join Date
- Apr 2011
- Posts
- 20
- Rep Power
- 0
maybe the classpath? have you checked it?
- 07-10-2011, 08:37 AM #11
Similar Threads
-
What wrong with it?case : public static void main
By bytescode in forum New To JavaReplies: 7Last Post: 02-10-2011, 07:01 AM -
What is the difference between Public Static Void and Public Void?
By whateverme in forum New To JavaReplies: 1Last Post: 12-04-2010, 05:41 PM -
Public static void main (String args[])
By arefeh in forum New To JavaReplies: 12Last Post: 01-28-2010, 11:58 AM -
Error: LengthCharAt.java:3: ';' expected public static void main (String[] args)
By antgaudi in forum New To JavaReplies: 9Last Post: 11-22-2008, 11:03 PM -
[SOLVED] Why main() in java is declared as public static void main?
By piyu.sha in forum New To JavaReplies: 5Last Post: 10-06-2008, 12:11 AM


LinkBack URL
About LinkBacks
Reply With Quote
-.gif)

Bookmarks