/****************** Exercise 8 ******************
* Create a class without a constructor, and then
* create an object of that class in main() to
* verify that the default constructor is
* automatically synthesized.
***********************************************/
public class E08_SynthesizedConstructor {
public static void main(String args[]) {
// Call the synthesized default constructor
// for this class:
new E08_SynthesizedConstructor();
}
}
* Create a class without a constructor, and then
* create an object of that class in main() to
* verify that the default constructor is
* automatically synthesized.
***********************************************/
public class E08_SynthesizedConstructor {
public static void main(String args[]) {
// Call the synthesized default constructor
// for this class:
new E08_SynthesizedConstructor();
}
}
//+M java E08_SynthesizedConstructor
**Since the constructor can be called, it must have been created, even if you can’t see it.
**Since I’m not using the reference that comes back from the new expression, I don’t need to create a variable to hold it.