So after a while I finally figured out the syntax to make a pretty simple password program. While I was at it, I thought I might try to run another method from a different class in the password program. Thing is, there were no errors, but the other methods would simply just not work. What is the proper syntax for getting a method from another class to work properly?
Here's the short little bit of code that Im trying to get the method to work in:
Code :package OtherStuff; import acm.program.ConsoleProgram; import java.util.*; public class stringPassword extends ConsoleProgram { String password = "bob"; public void run() { ageCalc acalc = new ageCalc(); while (true) { String input = readLine("Enter password here: "); if (input.equals(password)) { println("Access granted\n"); acalc.startAgeCalc(); break; } else println("Access denied\n"); } } }
The other class is called obviously called ageCalc and the method im trying to run is startAgeCalc();. Everything in startAgeCalc() is public, and besides that I can't think of any other reason why this wouldnt work. But then again, I would have no idea in the first place as this will be my first time trying to call on a method from another class.
Anyway, the solution is most likely simple, but I can't seem to figure it out. Could importing and extending ConsoleProgram be a playing factor? Thx in advance for the newbie help!

