*
The moose likes Beginning Java and the fly likes HELP!!! how do I call methods from a class???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "HELP!!! how do I call methods from a class????" Watch "HELP!!! how do I call methods from a class????" New topic
Author

HELP!!! how do I call methods from a class????

Bernard Shapiro
Greenhorn

Joined: Apr 07, 2003
Posts: 6
From the App class how do I call methods that are created in another class that I created? What is the syntax?
i.e. I have a Student class with a find() method... How do I call this from the App class???
Shraga van Shufel
Ranch Hand

Joined: Apr 20, 2003
Posts: 33
try Student.find();
or to initiate a new Student object
Student s = new Student();
s.find;
however you need to import your Student class if they are not in the same package.
/Shraga
Francis Siu
Ranch Hand

Joined: Jan 04, 2003
Posts: 867
hi Bernard

From the App class how do I call methods that are created in another class that I created? What is the syntax?

Firstly,I want to know another class is the same folder or not,in the following example,I assume the two class is in the same folder and differ file.
First class call App.java and another call Student.java
In the App class

In the Student class

I hope that this example can answer your question


Francis Siu
SCJP, MCDBA
 
Consider Paul's rocket mass heater.
 
subject: HELP!!! how do I call methods from a class????
 
Similar Threads
Getting input from the User
MVC/DAO - How are they connected?
How to store an object in 'application' scope in Spring when the server is started?
calling a method
Abstract class