An open API service indexing awesome lists of open source software.

https://github.com/isghe/xconstructorwrong

What happens in calling virtual methods in Java constructors
https://github.com/isghe/xconstructorwrong

constructor java unexpected virtual-methods

Last synced: 6 months ago
JSON representation

What happens in calling virtual methods in Java constructors

Awesome Lists containing this project

README

          

# XConstructorWrong.java

Simple example showing what happens in calling virtual methods in `Java` constructors.

First published on December 19, 2007 [java_subdolo_errore_1](http://www.isidoroghezzi.net/java_subdolo_errore_1.html)

## Compile
`$ javac -Xlint:all XConstructorWrong.java`

## Run
`$ java XConstructorWrong`

## "Unexpected" output
`null`