how to call method in another file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cllee
    New Member
    • May 2007
    • 1

    #1

    how to call method in another file?

    hello everyone, i may need urs help.

    i am facing problem now. i am using java applets. then, i have a method with a very long coding..So, i just open a new class. now, how do i call the method if in another file?

    can anyone help me please?Thanks .. u all ..can send the solution to <posting email is gainst site rules: removed by Admin >
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by cllee
    hello everyone, i may need urs help.

    i am facing problem now. i am using java applets. then, i have a method with a very long coding..So, i just open a new class. now, how do i call the method if in another file?
    It depends: normally you create an object (instantiation) of that other class.
    Next you can invoke all its public methods (or package methods if the class
    is in the same package as the calling class).

    Maybe the class offers static methods too, I can't tell without seeing the API
    docs or source code. btw, you don't "open" a new class nor does one call
    methods in "another file". It's all classes inside the JVM.

    kind regards,

    Jos

    Comment

    Working...