Results 1 to 5 of 5
  1. #1
    Aaron5466 is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default A class calling methods from external class

    I'm pretty new to Java, having taken only part of a class in data structures using Java. I'm also not that familiar with Object Oriented coding and terminology, so I apologize if I misuse it. The way I learned to code Java was to write a short main class that calls methods from an external class. I have a class that I want to keep pristine. So, I'd like to have a main class call a middle class that I modify and have that middle class call the class I'm keeping pristine. But, I can't get it to work. Any suggestions?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,920
    Rep Power
    19

    Default Re: A class calling methods from external class

    Not too sure what a "pristine" class is.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    ojn
    ojn is offline Senior Member
    Join Date
    Aug 2008
    Location
    Stockholm, Sweden
    Posts
    119
    Rep Power
    0

    Default Re: A class calling methods from external class

    My suggestion is that you go through the tutorials and ask a specific question about your code when you get stuck on something.

  4. #4
    Aaron5466 is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default Re: A class calling methods from external class

    Thanks. I will go through tutorials. By pristine, I mean that I was given a class by the professor, and I want to make sure I don't ruin it, so I'd rather use it and add new features to another class that works with it.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,920
    Rep Power
    19

    Default Re: A class calling methods from external class

    You could extend the original class, allowing you to just change/add the bits you want while keeping the rest.
    Then just call that one from main.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 16
    Last Post: 11-25-2011, 01:18 PM
  2. Calling base class methods
    By new2java2009 in forum New To Java
    Replies: 1
    Last Post: 11-15-2011, 10:47 PM
  3. Calling methods into another class? Help please!
    By javanator in forum New To Java
    Replies: 1
    Last Post: 03-20-2010, 06:19 PM
  4. 'Class' Object and calling Static Methods?
    By mikeiz404 in forum Advanced Java
    Replies: 3
    Last Post: 01-24-2009, 12:58 PM
  5. 'Class' Object and calling Static Methods?
    By mikeiz404 in forum New To Java
    Replies: 2
    Last Post: 01-24-2009, 05:10 AM

Posting Permissions

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