This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes can't run Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can Watch "can New topic
Author

can't run

Andrew Lit
Ranch Hand

Joined: Jul 01, 2002
Posts: 135
why can't i run such class:
public class class(){
void method(){
}
........
public static void main (String args[]){
..........
}
}
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

What error are you getting?
This should work:

/Rene
[ July 04, 2002: Message edited by: Rene Larsen ]

Regards, Rene Larsen
Dropbox Invite
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

You can compile it because class is a reserved word in Java and in Java we do not put () after the name.
/Rene
Andrew Lit
Ranch Hand

Joined: Jul 01, 2002
Posts: 135
it works indeed. the problem was because i didn't use static keyword in my code (for some reasons )
but thanx anyway.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can't run