On Aug 8, 4:15 am, chEveLLe <[email protected]> wrote:
> I see. I was used to knowing that classes always have their
> constructor/s. I guess this is one exception.
>
> Thanks alot.
Each class has its own constructor, but not all classes give access to
their constructors.
This is the case for Runtime class whose constructor is private
 (you can see it is you decompile with a tool like JarInspector or the
equivalent for your system or if you have the source). The class is in
java.lang

Extract of it:
private static Runtime currentRuntime = new Runtime();
...
 /** Don't let anyone else instantiate this class */
    private Runtime() {}

You will find the same for singleton classes whose constructors are
inner, thus cannot be access from outer classes.

So, to resume, every class has a constructor, you cannot always access
this constructor.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to