Results 1 to 4 of 4
  1. #1
    lancebogz is offline Member
    Join Date
    Feb 2013
    Posts
    1
    Rep Power
    0

    Default java overload ..please help

    public LinkedListNode link;

    }
    public class JavaApp5
    {
    public LinkedListNode current, newNode, head;
    int counter = 0, hold = 0;

    public void addNode(int _data){
    LinkedListNode newNode = new LinkedListNode();
    newNode.data = _data;
    LinkedListNode current = head;
    newNode.link = current;
    head = newNode;
    counter++;
    }

    /*public void addNode(int _data, int pos)
    this is where i should put the overload code
    */

    /*public void deleteNode(int loc){

    */

    public void displayList(){
    current = head;
    for(int i=0; i < counter; i++){
    System.out.println("Priority: "+current.data);
    current = current.link;
    }
    }
    public static void main(String[] args){
    JavaApp5 list = new JavaApp5();

    list.addNode(1);
    list.addNode(2);
    list.addNode(3);
    list.addNode(4);
    list.displayList();
    }
    }

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,882
    Rep Power
    8

    Default Re: java overload ..please help

    Please don't post multiple copies of the same question. I deleted your duplicate post.

    When posting code, please use the code tags and post code as an SSCCE.

    Asking a question also helps.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,882
    Rep Power
    8

    Default Re: java overload ..please help

    I deleted yet another duplicate post. Please stop doing that, or you'll be marked as a spammer.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    Ronin is offline Senior Member
    Join Date
    Oct 2010
    Posts
    317
    Rep Power
    4

    Default Re: java overload ..please help

    Hello lancebogz,

    What is your question?

    The article below may be of interest to you:

    Defining Methods (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

    Regards.

Similar Threads

  1. question about overload
    By tripline in forum New To Java
    Replies: 11
    Last Post: 10-28-2011, 05:23 AM
  2. Replies: 0
    Last Post: 03-31-2010, 05:18 AM
  3. Help with this code, overload the constructor
    By zoe in forum New To Java
    Replies: 12
    Last Post: 11-03-2008, 02:55 AM
  4. return type determines override/overload?
    By hedefalk in forum Advanced Java
    Replies: 4
    Last Post: 07-11-2007, 01:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •