Results 1 to 2 of 2
  1. #1
    zdavis is offline Member
    Join Date
    Mar 2012
    Posts
    1
    Rep Power
    0

    Default Calling methods in other files

    I am taking a beginning java class based in a unix environment. I have to create three .java files. One that prints out a simple line of text, one to call the method that prints the line of text and another file that contains the Main that calls the 2nd file. I have tried this a number of different ways to no avail so I am hoping someone can point me in the right direction.

    Thanks in advance and sorry if the above explanation is hard to understand.

  2. #2
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default Re: Calling methods in other files

    and another file that contains the Main that calls the 2nd file.
    I think thats where everyone has lost you. But this is what I've made of your question:

    You have three tasks (each in a separate class/java file)
    1. Make a class that prints a line of text
    2. Make a second class to call the method from the first class that prints a line of text
    3. Make a third class with a Main method (for command line) that calls the method in the second class (which calls the method in the first class to print the line of text)

    And you've done the first and second class and you're having a problem with the third class?

Similar Threads

  1. Calling methods
    By Alkor in forum New To Java
    Replies: 15
    Last Post: 02-25-2012, 02:33 PM
  2. calling methods on an applet from cli
    By matpen in forum Java Applets
    Replies: 3
    Last Post: 02-20-2011, 07:52 AM
  3. Calling for methods
    By soccer_kid_6 in forum New To Java
    Replies: 3
    Last Post: 02-27-2010, 09:12 PM
  4. Calling Methods
    By bluegreen7hi in forum New To Java
    Replies: 3
    Last Post: 12-17-2007, 06:22 AM
  5. need help calling methods
    By lowpro in forum New To Java
    Replies: 2
    Last Post: 11-15-2007, 09:53 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
  •