The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 327 Weeks Ago, 5 Days Ago |
| Questions Answered: | 12843 |
| Tutorials Posted: | 12834 |
MBA, Ph.D in Management
Harvard university
Feb-1997 - Aug-2003
Professor
Strayer University
Jan-2007 - Present
a java program by regular expression and array . question see the attach files
Laboratory460-212Objectives:To understand how to use command line arguments. understand arrays in Java.To write a static method that returns an array.Download the partially definedclass Lab4 from the course website. At the moment this containsonly a main method.Work to be donea)Set the command line arguments as follows:25 xyz+39-43abc“+86”34a6This means your command line arguments are “25”, “xyz”,“+39”, “-43”, “abc”,“+86” and“34a6”(Note: See instructions below on how to set command line arguments using Eclipse).b)Write a method extractValidNumbers which has an array of strings as its parameter. Notethat main calls extractValidNumbers using the array of command line arguments as theparameter. The method should return an array of int. The partial class definition Isupplied does not include method extractValidNumbers which is your responsibility.Hint:the method header can be as follows:private static int[] extractValidNumbers(String commandLineArguments[])(Questions you should be able to answer - why is the method private? Is that better thanpublic? Why is the method static? What does it mean when the return type for themethod is int[]?)
Attachments:
-----------