Cheap Web Hosting | Free Web Hosting | Dedicated Server | Windows Hosting | Free Web Space | Web Hosting | FrontPage | Business Web Hosting
cheap web hosting
Search the Web

www.go4java.20m.com
 

 

A Place for Java Programmers!
 
 

 

In this table I have explained the relation of different modifiers with classes, variables, contructors, methods, initializer blocks like which modifiers are allowed with classes, variables, contructors, methods, initializer blocks,interfaces:

COMBINATION OF FEATURES AND MODIFIERS

Modifier

Top-Level Class

Variable

Method

Constructor

Initializer Block

Interface
public

Yes

Yes

Yes

Yes

No Yes
protected No

Yes

Yes

Yes

No No
No-modifier

Yes

Yes

Yes

Yes

Yes Yes
private No Yes Yes Yes No No
final Yes Yes Yes No No No
abstract Yes No Yes No No Yes(always)
static No Yes Yes No Yes No
native No No Yes No No No
transient No Yes No No No No
volatile No Yes No No No No
synchronized No No Yes No Yes No