# Time Travel with JVM

DevFeed: [Time Travel with JVM](<https://devfeed.tech/articles/time-travel-with-jvm-24838.md>)

Original publisher: [Read original article](<https://alidg.me/blog/2020/2/23/time-travel-jvm>)

Author: Alimate

Published: 2020-02-23T00:00:00Z

Content type: article

Language: en

Sources: [Ali Dehghan - Kemikit](<https://devfeed.tech/sources/ali-dehghan-kemikit.md>)

Topics: [constructor](<https://devfeed.tech/topics/constructor.md>)

Tags: [bytecode](<https://devfeed.tech/tags/bytecode.md>), [constructor](<https://devfeed.tech/tags/constructor.md>), [java](<https://devfeed.tech/tags/java.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [object](<https://devfeed.tech/tags/object.md>)

## AI overview

The excerpt describes allocating a Java object without running its constructor. Normal `new` allocation first gives fields default values, then runs instance initializers and constructors; the example's constructor replaces a default value with the current epoch time. The described alternative bypasses the constructor, leaving the object with default-initialized fields. The excerpt warns that compiling code using this mechanism may produce a warning and advises staying away from it. Code and class names are omitted from the supplied text.

## Source excerpt

Let's allocate a Java object without calling its constructor!