Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Calling methods from within another class.

Reply
Thread Tools

Calling methods from within another class.

 
 
James via JavaKB.com
Guest
Posts: n/a
 
      03-28-2005
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to find the class methods of a class, just like'methods' finds the instance methods? Kenneth McDonald Ruby 5 09-26-2008 03:09 PM
Avoid calling non-final methods in a constructor: Applies to static methods too? Oliver Wong Java 14 06-13-2006 09:18 AM
Problem with Calling Methods from Objects which are stored in an array from within another Object Andreas Schmitt C++ 6 07-29-2005 03:44 PM
Calling methods from within another class. James via JavaKB.com Java 4 03-31-2005 11:05 AM



Advertisments