aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Command line arguments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Command line arguments" Watch "Command line arguments" New topic
Author

Command line arguments

aswin penugonda
Greenhorn

Joined: Jun 16, 2009
Posts: 9
class Main
{
public static void main (String[] args)
{
System.out.println(args);
}
}

Output:
java.lang.String@1a46e30

Here I am not passing any command line arguments while running this class.But an object is being created why?

Please answer
Prithvi Sehgal
Ranch Hand

Joined: Oct 13, 2009
Posts: 774
Hi,

If you don't pass anything, an empty String array is created by JVM itself. At the end array is an object.
That's why an object is being printed out.

Hope this helps,


Prithvi,
My Blog, Follow me on Twitter,Scjp Tips, When you score low in mocks, Generics,Scjp Notes, JavaStudyGroup
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Command line arguments