So I have a class called lines and main called line Tester, I put an (if) statement in class lines that will check my input for negative values.Compiles fine, in my main I am using Switch/case method for my menu. I am not sure how to call my validation that I built in class lines. and were do I put it, tried within the Switch/case within the case one were my data is being entered but it barked at me,any suggestion project is due Wednesday at midnight so I have time.
Data Validation
Collapse
X
-
Tags: None
-
If both the class are in same package then it can be done by simply creating a object of class [lines] and with the help of that object you can access that validation method. If they are not in same package then create a interface to access it or define that method as static then create class Lines object and now you can access static method of class Lines in Main class.
Comment