Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Ayden Smith   on May 14 In Java Category.

  
Question Answered By: Burk Martin   on May 14

Try this:

...

public static void  main(String[] args){
...
}

public static boolean isValidNum(...){
...
}

public static boolean isValidDate(...){
...
}

public static boolean isValidEmail(...){
...
}

And the result is as:

Invalid string  : New York
java.text.ParseException: Unparseable date: "30/02/2002"
Invalid date  : 30/02/2002
Valid email  : NY@y...
Process exited with exit code 0.

My understanding is that the main  method has to be defined as
public static void main(String[] args)

And the methods called in main() are also to be defined as "static".

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 


Tagged: