Skip to main content

Posts

Showing posts with the label construct

What is the rationale behind this code block in java?

What is the rationale behind making this kind of code valid in java? Does it exist for some particular reason or is it just a byproduct of other Java language design decisions? Can't you just use the consructor to achieve the same effect? class Student { { System.out.println("Called when Student class is instantiated."); } }