A
Andy
Say I have 2 files -
addition.java
negation.java
Now in the main class (say controlpanel.java) I want something like
this -
Print -" You want addition? Press 1"
" You want negation? Press 2"
then it should run addition.java when the user inputs 1 or negation if
the user inputs 2
Basically, the user will enter information (like a=1 and b=2 for a+b)
in addition.java (or negation.java) and not controlpanel.java
controlpanel.java is the main class to forward the user to a
particular class for operation. All these classes are under the same
Netbeans package.
How can this be done? This is basic and I couldn't figure it out :
( Switch statements were clueless about running classes from a main
class.
Thanks a lot!
addition.java
negation.java
Now in the main class (say controlpanel.java) I want something like
this -
Print -" You want addition? Press 1"
" You want negation? Press 2"
then it should run addition.java when the user inputs 1 or negation if
the user inputs 2
Basically, the user will enter information (like a=1 and b=2 for a+b)
in addition.java (or negation.java) and not controlpanel.java
controlpanel.java is the main class to forward the user to a
particular class for operation. All these classes are under the same
Netbeans package.
How can this be done? This is basic and I couldn't figure it out :
( Switch statements were clueless about running classes from a main
class.
Thanks a lot!