Calling methods from within another class.

Discussion in 'Java' started by James via JavaKB.com, Mar 28, 2005.

  1. Hi,

    I'm setting up two servlet classes:

    issueOptions() (in issueOptions.java) and menuUI() (in menuUI.java).

    Both are in the same package: menu.

    menuUI has a method inside called issueOverview().


    I want to call and execute the issueOverview() method from the issueOptions
    class, but how do I do this? I have been trying to do by creating an
    instance of the menuUI class, but I cannot be doing correctly. I have
    posted the following code (which I hope is useful) and the error produced
    upon compiling:

    menuUI.java
    ~~~~~~~~~~~
    package menu;

    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.text.DateFormat.*;
    import java.util.Date.*;

    public class menuUI extends HttpServlet {
    //Initialize global variables
    .....
    ......
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    connection = DriverManager.getConnection(URL, "", "");
    ....

    --
    Message posted via http://www.javakb.com
     
    James via JavaKB.com, Mar 28, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James via JavaKB.com

    Calling methods from within another class.

    James via JavaKB.com, Mar 28, 2005, in forum: Java
    Replies:
    4
    Views:
    622
    James via JavaKB.com
    Mar 31, 2005
  2. Andreas Schmitt
    Replies:
    6
    Views:
    380
    Andreas Schmitt
    Jul 29, 2005
  3. Oltmans
    Replies:
    6
    Views:
    356
    Terry Reedy
    Mar 11, 2009
  4. Pat Maddox
    Replies:
    1
    Views:
    94
    George Ogata
    Nov 26, 2006
  5. Kenneth McDonald
    Replies:
    5
    Views:
    329
    Kenneth McDonald
    Sep 26, 2008
Loading...

Share This Page