Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can't run

 
Andrew Lit
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why can't i run such class:
public class class(){
void method(){
}
........
public static void main (String args[]){
..........
}
}
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error are you getting?
This should work:

/Rene
[ July 04, 2002: Message edited by: Rene Larsen ]
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic