Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7035161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:16:18+00:00 2026-05-28T01:16:18+00:00

I wrote this class : public class ListArg { public static void main(String args[])

  • 0

I wrote this class :

public class ListArg {
    public static void main(String args[])
    {
        for(int i=0;i<args.length;i++)
        {
            System.out.println(args[i]);
        }
    }
}

javac ListArg.java // compiled class

I compiled above class and run like :
java ListArg *

But ListArg is displaying current directory contents on console and not “*”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:16:19+00:00Added an answer on May 28, 2026 at 1:16 am

    EDIT: Looks like I was wrong and this might be Java doing it after all. If you’re using a Unix shell, this is probably just the shell performing “globbing”. However, it appears to do the same thing on Windows, which surprises me (as the Windows command line doesn’t perform globbing by default).

    Unfortunately, on Windows the normal quoting appears to give you a quoted argument, i.e. if you print args[0] having run

    java ListArg '*'
    

    it will include the single quote. I’m investigating whether there’s a way of disabling this… although that would work on a Unix shell.

    EDIT: Hmm… no luck so far in managing to have a string of just a star in Windows 🙁

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just wrote this test code in my CustomUIPanel class: public static void main(String[]
I wrote this program in Java public class Why { public static void test()
I wrote this: public static class EnumerableExtensions { public static int IndexOf<T>(this IEnumerable<T> obj,
Okay, so i have this code i wrote: class Connection { public static StreamWriter
i wrote this program in VC++ 2010: class class1 { public: class1 (initializer_list<int> a){};
I wrote something like this: class Storage { public: Storage(); QString key() const; int
I wrote this code: public class CustomData { public int F1 { get; set;
I wrote this attribute extension: public class LocalizedRequiredAttribute : RequiredAttribute { public LocalizedRequiredAttribute(string resourceTag)
For this assignment I had to create my own string class. I initially wrote
i wrote this code: class A { public: A(){d=2.2;cout<<d;} A(double d):d(d){cout<<d;} double getD(){return d;}

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.