Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

absctract class

 
jacob deiter
Ranch Hand
Posts: 583
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abstract class abstractclass {

abstract void fgf();

{
fgf();
System.out.println("hi");
}

}


please explain code in bold.Bold block is static method or anonymous class or what is this?
 
Campbell Ritchie
Sheriff
Posts: 48404
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use the code button; don't put bold tags inside it.
Where does that code come from, or did you concoct it yourself?
The block you have marked looks like an instance initialiser.
 
Ryan Beckett
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The block with only delimiters is a static initializer block.
 
Henry Wong
author
Marshal
Pie
Posts: 20892
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ryan Beckett wrote:The block with only delimiters is a static initializer block.



Actually, the code in bold is an instance initializer block. (which Campbell already mentioned).

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic