Im having a problem with this code.could somebody help?....
public class WriteAMessage
{
public static void main(String []args)
{
if(null == args || args.length < 1)
{
System.out.println("No message to print. Sorry.");
System.exit(1);
}
}//end the if block
String message = new String();
//String message = formatArguments(args);
message += formatArguments(args);
System.out.println(message);
}//end of the main method
public static String formatArguments(String msg[])
{
String myArgs =new String();
for(int i=0 ; i < msg.length ; i++)
{
myArgs
+= msg[ i ] + " ";
}//end the for statement
return myArgs;
}//end formatArguments method
}//end the class
|