It's not a secret anymore!*
The moose likes Beginning Java and the fly likes absctract class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "absctract class" Watch "absctract class" New topic
Author

absctract class

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
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

Joined: Oct 13, 2005
Posts: 37976
    
  22
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

Joined: Feb 22, 2009
Posts: 192
The block with only delimiters is a static initializer block.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18520
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: absctract class
 
Similar Threads
abstract method overriding
fun with main() and abstract
abstract method
Abstract Class
Abstract class