This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

absctract class  RSS feed

 
jacob deiter
Ranch Hand
Posts: 587
  • 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: 55344
157
  • 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
Sheriff
Posts: 23279
125
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
Boost this thread!