This is my Book.java code
public class Book {
private int pageNumber;
private class BookReader{
public int getPage(){
return pageNumber;
}
}
}
When I complied it and used javap
I got following things for the two classes
For Book$BookReader.class
This is the output code
Compiled from "Book.jav
class Book$BookReader {
final Book this$0;
public int getPage();
}
My question is why final is added while making any reference here and why this reference was made? What is its use in innerclass?
For Book.class
$ javap Book.class
Compiled from "Book.java"
public class Book {
public Book();
static int access$000(Book);
}
Why static is added for variable and why Book has been passed as parameter here?
Please explain it in simple terms if possible!