Can I create a non-explicit constructor for a Java class?
<p>By default, C++ will do "auto promotion" in assignment if appropriate constructors exist (and are not declared <code>explicit</code>).</p>

<p>In Java, this behavior doesn't happen by default.  If I want automatic promotion, is there a way to declare my constructors as implicit?</p>

<p>For example, here is some C++ code that has the effect that I want:</p>

<pre><code>class Foo {
    public:
        Foo(string) { /* ... */ }
        /* Foo's methods and stuff */
};

void DoSomethingWithAFoo(Foo foo)
{
    /* ... */
}

int main()
{
    string s = "I am a happy string, I swear!";

    DoSomethingWithAFoo(s);    

    return 0;
}
</code></pre>

<p>Generally, in C++ this is allowed, and the <code>string s</code> will be automatically promoted (by constructing a temporary <code>Foo</code> from <code>s</code>).<br>
Since the <code>Foo(string)</code> constructor is not marked explicit, I don't even need a typecast.</p>

<p>Is there a way to do this in Java?</p>

<p>I ask because I am trying to create a specific type that represents any one of a specific variety of other types.  For example, imagine a <code>class Primitive</code> that was representing either a single boolean, integer, character, or double (that's not my specific example, but it is related).  </p>

<p>Methods in my system that expect a Primitive should also accept any of the "real types" that the Primitive might represent (by auto-promotion to an anonymous object of type Primitive through a constructor call).  </p>

<p>In my actual work (as opposed to this example), my equivalent to the <code>Primitive</code> class has constructors both from a few primitive types as well as several object types (each constructor taking only the one parameter).  Ideally I would want auto promotion for all of them.</p>
