Samples JDK
Main Page
Related Pages
Packages
Classes
Files
File List
src
com
freemindcafe
oops
innerclass
mypackage
A.java
1
package
com.freemindcafe.oops.innerclass.mypackage;
2
3
import
com
.
freemindcafe
.
oops
.
innerclass
.
library
.
IMessageProvider
;
4
import
com
.
freemindcafe
.
oops
.
innerclass
.
library
.
MessageProcessor
;
5
6
7
public
class
A
{
8
9
public
static
void
main(String[] args) {
10
MessageProcessor
messageProcessor =
new
MessageProcessor
();
11
12
//Every classes objects can be passed
13
//and can be used in other packages outside of this package.
14
//These access qualifiers are applicable only at compile time.
15
16
messageProcessor.process(
new
B());
17
messageProcessor.process(
new
A
().
new
C
());
18
messageProcessor.process(
new
D());
19
}
20
21
//nested static private class
22
private
static
class
B
implements
IMessageProvider
{
23
24
@Override
25
public
String provideMessage() {
26
return
"in B"
;
27
}
28
29
}
30
31
//inner class (nested public class)
32
public
class
C
implements
IMessageProvider
{
33
34
@Override
35
public
String provideMessage() {
36
return
"in C"
;
37
}
38
39
}
40
41
//nested static public class
42
public
static
class
D
implements
IMessageProvider
{
43
44
@Override
45
public
String provideMessage() {
46
return
"in D"
;
47
}
48
49
}
50
51
}
com.freemindcafe.oops.innerclass.library.MessageProcessor
Definition:
MessageProcessor.java:7
com.freemindcafe.oops.innerclass.mypackage.A.C
Definition:
A.java:32
com.freemindcafe.oops
com.freemindcafe.oops.innerclass.library
Definition:
IMessageProvider.java:1
com
com.freemindcafe
com.freemindcafe.oops.innerclass.library.IMessageProvider
Definition:
IMessageProvider.java:4
com.freemindcafe.oops.innerclass
com.freemindcafe.oops.innerclass.mypackage.A
Definition:
A.java:7
Generated on Fri Feb 19 2016 08:35:43 for Samples JDK by
1.8.9.1