wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Accessing methods HELP! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Accessing methods HELP!" Watch "Accessing methods HELP!" New topic
Author

Accessing methods HELP!

Naf Rash
Ranch Hand

Joined: Feb 19, 2004
Posts: 85
How do you access/invoke a method from another class? Please could you provide an example.
David Maddox
Greenhorn

Joined: Feb 25, 2004
Posts: 12
ok here is an example
public class Dog{
public void bark(){
}
}

public class dogTest{
Dog dog= new Dog(); /*you create a dog object and it has all of its methods/*
dog.bark();
}
[ February 26, 2004: Message edited by: David Maddox ]
[ February 26, 2004: Message edited by: David Maddox ]
Naf Rash
Ranch Hand

Joined: Feb 19, 2004
Posts: 85
I think that you may have forgotten to post the example! Thanks.
Naf Rash
Ranch Hand

Joined: Feb 19, 2004
Posts: 85
Ignore what I just said for some reason the code did not load earlier on. Sorry.
David Maddox
Greenhorn

Joined: Feb 25, 2004
Posts: 12
yeah i hit the wrong button
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing methods HELP!