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
- Host: GitHub
- URL: https://github.com/isghe/xconstructorwrong
- Owner: isghe
- Created: 2019-12-24T06:48:18.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-24T07:12:09.000Z (about 6 years ago)
- Last Synced: 2025-05-13T21:19:16.873Z (9 months ago)
- Topics: constructor, java, unexpected, virtual-methods
- Language: Java
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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`