This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

More help on java modifications

 
Troy Johnson
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. Thanks for everyones assistance on this problem. Again, I am working on making two modifications to the program. The first is to Ignore cases, which I have successfully completed. The second is to Use a command-line argument. I have utilized suggestions on using the command-line argument into the program and have implemented them into my program. My program compiles, but I get the following error message when I run the application: Exception in thread "main" java.lang.NoSuchMethodError: main. Could anyone offer any more suggestions or insight on this. Thanks.
Here is my code before using the command-line argument:

Here is my code after using a command-line argument, which I get the NoSuchError method when trying to run the application.

[ October 12, 2003: Message edited by: Troy Johnson ]
[ October 12, 2003: Message edited by: Troy Johnson ]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only the "Palindrome" class has a main(), so you can only run that class -i.e., "java Palindrome". If you try to run "problem" you'll get this error. (Not sure what the other class is for, actually.)
 
Wirianto Djunaidi
Ranch Hand
Posts: 210
Ruby Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually the second code does not compile, because the main() method is in Palindrome class and it was declared with default access modifier. Instead you have your problem class declared as public.
You should declare your Palindrom class as public instead of problem.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You only need that part of code I posted in your other thread, and run it with an argument
 
Troy Johnson
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael, thanks for your help. I guess I am still a little unclear on running an argument to that code? Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic