File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes CAN ANY BODY MADE THIS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "CAN ANY BODY MADE THIS " Watch "CAN ANY BODY MADE THIS " New topic
Author

CAN ANY BODY MADE THIS

khurram babar
Greenhorn

Joined: May 13, 2003
Posts: 4
Write a program that throws an exception when the user doen not enter any arguments at the command line The program should also display the number of arguments
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Doing your own homework is both mentally and spiritually rewarding.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
John Lee
Ranch Hand

Joined: Aug 05, 2001
Posts: 2545
if you want to learn java, the best way is to write program.
Donald R. Cossitt
buckaroo
Ranch Hand

Joined: Jan 31, 2003
Posts: 401

Can anybody made this?

Maybe not anybody, but nearly.


doco
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9043
    
  10
Here is a start.



JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Here is a start.

Do I detect a sarcastic tone here?


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Francis Siu
Ranch Hand

Joined: Jan 04, 2003
Posts: 867
hi khurram
Thomas said
Doing your own homework is both mentally and spiritually rewarding.
Absolute agree
Do I detect a sarcastic tone here?

My suggestion is that when you compile the coding which is finished all the requirement of your homework and contains some error,you can post it to us to discuss what wrong with it.
No ones will get the experience if they do not write the coding.
One more question if you want to answer,
Do you like Java language or writing program?


Francis Siu
SCJP, MCDBA
Yogini Shirodkar
Greenhorn

Joined: May 22, 2003
Posts: 3
Hi here is the code
public static void main(String arg[])
{
try{
if(arg.length==0)
{
throw new Exception();
}
}
catch(Exception e)
{
System.out.println(" Please pass the command line argument ");
}
finally
{
System.out.println(" Toatal number of arguments are "+arg.length);
}
}
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4419
    
    5

:roll: There's always somebody who doesn't get it...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: CAN ANY BODY MADE THIS
 
Similar Threads
agument into the main method in eclipse
problems with in.read()
Process err- not a valid Win32 application
code compiles with no errors but doesn't not create a class with pdf fields
Why????