Data Validation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pjsicurello43
    New Member
    • Nov 2011
    • 3

    Data Validation

    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.
  • kuldeeprsks
    New Member
    • Dec 2011
    • 22

    #2
    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

    Working...