I Wrote the following Code
public class Reader1 {
private int pageNumber;
private class ReaderName1{
public int getPage(){
return pageNumber;
}
}
static class ReaderFound{
}
}
When I used the Java Class File Disassembler javap on the compiled code I got
1. for Reader1.class
class Reader1$ReaderName1 {
final Reader1 this$0;
private Reader1$ReaderName1(Reader1);
public int getPage();
}
2. for Reader1$ReaderName1.class
public class Reader1 {
private int pageNumber;
public Reader1();
static int access$000(Reader1);
}
3. for Reader1$ReaderFound.class
class Reader1$ReaderFound {
Reader1$ReaderFound();
}
My question is since ReaderFound is a static class how can it have an default constructor ? If so why ? Is it allowed ?
If allowed what kind of constructor is this that is found inside the class Reader1$ReaderFound because it can't be static. (Also since constructor are implicitly called to initilize an object and since ReaderFound is an static class so there would we no object of it. My point for first question)