Virtual function call from constructor

M

Mike Schilling

Eric Sosman said:
No; that's the Java language. If Object's constructor
ultimately chained from a PrintStream constructor were to
evaluate `this instanceof PrintStream' the result would be
`true', on every JVM. (Object's constructor has no reason
to do any such thing, but that's another matter.)

The question was "Does Object even have a nontrivial constructor?" That is,
whether its constructor contain any code. As far as I know, that can differ
between implementations.
 
T

Tom Hawtin

Mike said:
The question was "Does Object even have a nontrivial constructor?" That is,
whether its constructor contain any code. As far as I know, that can differ
between implementations.

You can rewrite the Object constructor using instrumentation, so I
believe all implementation should allow the Object constructor to
contain real Java code.

Tom Hawtin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top