Will there be an instance of blocks in the abstract class?



  • And if they work, what happens?



  • https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.6 will always be able to produce a copy of the class that inherits https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html#jls-8.1.1.1 :

    A subclass of an abstract class that is not abstract itself may be instantiated, resulting in the execution of a constructor for the abstract class and, therefore, the execution of the field initializers for instance variables of that class.

    Translation:

    A copy of the heir to an abstract class that is not abstract may be created, which will result in the construction Abractic class and initiators of the field of a copy for this class.

    Procedure for establishing a new copy is described in https://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.5 or https://ru.stackoverflow.com/questions/464028/ ♪


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2