File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing main class so it can be called from a another main class

 
thomas colding
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Class that trows a exception, but i Would like to call it from a another main Class, and it still have to trow a exception.

The following Class is that I would like to have changed.

public static void main(String[] args)
throws ParserConfigurationException, SAXException,
IOException, XPathExpressionException {

}


thanks in advance
 
fred rosenberger
lowercase baba
Bartender
Pie
Posts: 12023
25
Chrome Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried, and what happened when you did?
 
Max Rahder
Ranch Hand
Posts: 177
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public static void main(String[] args) is a method like any other. Any method in any class can reference it via YourClassName.main(), passing either a String[] or null, depending on what's in main. If you want to know about exception handling, there are lots of posts to this forum, and other sources of information, that explain the syntax options when calling a method that is declared to throw exceptions.
 
Maneesh Godbole
Saloon Keeper
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
m iq wrote:


Please check your private messages for an important administrative matter
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic