Public class Main { Associate T = new Associate(); public static void main(String[] args) { } void go(){ T.AmountPerHour(); T.TimeAndaHalf(); T.sumofPay(); } } /*ok how do i access my go method from my main method someone please help me*/
-
-
Answer:
public class Main { Associate T = new Associate(); public static void main(String[] args) { } void go() { T.amountPerHour(); T.TimeAndaHalf(); T.sumofPay(); } } To access the go method, you've got some choices: 1) set both go and the member variable as static. 2) instantiate a new Main object within the main, and call the go method from that new object. Both will work, but which is correct kind of depends what the situation is.
Anonymous at Answerbag.com Visit the source
Related Q & A:
- How can i access the number of questions asked on stackoverflow?Best solution by Meta Stack Overflow
- How do I access the parent panel?Best solution by Stack Overflow
- How do I override an object method in JavaScript?Best solution by stackoverflow.com
- How do I access "My Briefcase" on the new My Yahoo?Best solution by Yahoo! Answers
- How can I access my chat logs in the new MSN?Best solution by im.about.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.